:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #1d2430;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #006847;
  --accent-dark: #005238;
  --danger: #ce1126;
  --warn: #d97706;
  --ok: #16a34a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 11px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select {
  font: inherit;
  font-size: 11px;
}

button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

button:disabled { opacity: .55; }

button.ghost {
  background: #e7eaef;
  color: #202938;
}

.hidden { display: none !important; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.login-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

h1, h2, p { margin-top: 0; }
h1, h2, h3, p { font-size: 11px; }
p { color: var(--muted); }

label {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 11px;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 6px 8px;
}

.shell {
  width: min(1280px, calc(100% - 24px));
  max-width: none;
  margin: 0 auto;
  padding: 12px 0;
}

header {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

header h1 {
  margin: 0;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.menu-button {
  display: none;
}

.top-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-nav button.active {
  background: var(--accent);
  color: #fff;
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

#runStatus {
  color: var(--muted);
  font-size: 11px;
  width: 100%;
}

.top-progress {
  display: grid;
  gap: 5px;
  width: 100%;
}

.top-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.top-progress-head span {
  color: #006847;
  font-weight: 800;
}

.top-progress-head strong {
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
}

.top-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.top-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #006847, #4baf85, #006847);
  background-size: 200% 100%;
  animation: progressMove 1.1s linear infinite;
  transition: width .25s ease;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .12), rgba(37, 99, 235, .10)),
    var(--panel);
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #006847;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
}

.overview-hero h2 {
  margin: 0 0 5px;
  font-size: 16px;
}

.overview-hero p {
  margin: 0;
}

.health-ring {
  --score: 0deg;
  width: 96px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--score), #e8edf4 0);
  position: relative;
}

.health-ring::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--panel);
}

.health-ring strong,
.health-ring span {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
}

.health-ring strong {
  font-size: 16px;
}

.health-ring span {
  margin-top: 18px;
  color: var(--muted);
  font-size: 9px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 10px;
  margin-bottom: 10px;
}

.chart-panel h2 {
  margin-bottom: 8px;
}

.ratio-bars {
  display: grid;
  gap: 8px;
}

.ratio-bars div {
  display: grid;
  grid-template-columns: 72px 44px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.ratio-bars span {
  color: var(--muted);
}

.ratio-bars b {
  font-size: 11px;
}

.ratio-bars i {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.ratio-bars em {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .35s ease;
}

.ratio-bars div:nth-child(2) em { background: var(--warn); }
.ratio-bars div:nth-child(3) em { background: var(--danger); }

.overview-kv {
  display: grid;
  gap: 8px;
}

.overview-kv div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
}

.overview-kv span {
  color: var(--muted);
}

.overview-kv strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.module-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.module-result {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.module-result.module-link-situs { border-color: #99d8c8; box-shadow: inset 4px 0 0 #006847; }
.module-result.module-utama { border-color: #adc8ff; box-shadow: inset 4px 0 0 #006847; }
.module-result.module-navi { border-color: #f4cf7b; box-shadow: inset 4px 0 0 #d97706; }
.module-result.module-cs { border-color: #c4b5fd; box-shadow: inset 4px 0 0 #7c3aed; }
.module-result.module-link-situs .module-result-head strong { color: #006847; }
.module-result.module-utama .module-result-head strong { color: #005238; }
.module-result.module-navi .module-result-head strong { color: #b45309; }
.module-result.module-cs .module-result-head strong { color: #6d28d9; }

.module-result.ok { border-color: #a7e0bd; }
.module-result.fail { border-color: #f5c56b; background: #fffdf0; }
.module-result.module-link-situs { box-shadow: inset 4px 0 0 #006847; }
.module-result.module-utama { box-shadow: inset 4px 0 0 #006847; }
.module-result.module-navi { box-shadow: inset 4px 0 0 #d97706; }
.module-result.module-cs { box-shadow: inset 4px 0 0 #7c3aed; }

.module-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.module-result-head b {
  color: var(--muted);
  font-size: 10px;
}

.module-result.fail .module-result-head b {
  color: var(--danger);
}

.module-result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.module-result-stats span,
.module-result-time {
  color: var(--muted);
  font-size: 10px;
}

.module-result-stats strong {
  display: block;
  font-size: 12px;
}

.module-result.fail .progress-fill { background: var(--danger); }

.intelligence-panel {
  margin-bottom: 10px;
}

.insight-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.insight-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.insight-card.ok {
  border-color: #9ed9bf;
  background: #f3fbf7;
}

.insight-card.warn {
  border-color: #e8c86c;
  background: #fffaf0;
}

.insight-card.fail {
  border-color: #ef9baa;
  background: #fff1f3;
}

.insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.insight-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-head b {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.insight-card.ok .insight-head b { color: var(--ok); }
.insight-card.warn .insight-head b { color: #a16207; }
.insight-card.fail .insight-head b { color: var(--danger); }

.insight-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.insight-metrics span,
.insight-reasons span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.insight-metrics strong,
.insight-reasons strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.insight-reasons {
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.insight-samples {
  display: grid;
  gap: 4px;
}

.insight-samples span {
  min-width: 0;
  padding: 5px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .68);
  color: #9f1239;
  font-size: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ai-panel {
  margin-bottom: 10px;
}

.compact-button {
  width: auto;
  min-height: 28px;
  padding: 0 10px;
  font-size: 10px;
}

.ai-insight-box {
  display: grid;
  gap: 8px;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ai-insight-box p {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.ai-insight-status {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef8f6;
  color: #006847;
  font-size: 10px;
  font-weight: 900;
}

.ai-insight-section {
  display: grid;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.ai-insight-section strong {
  color: var(--text);
  font-size: 10px;
}

.ai-insight-section span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.daily-task-panel {
  margin-bottom: 10px;
}

.daily-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.daily-task-head h2 {
  margin: 0;
}

.daily-task-head span {
  color: var(--muted);
  font-size: 10px;
}

.daily-task-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.daily-user-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.daily-user-tabs button {
  position: relative;
  overflow: hidden;
  width: auto;
  min-height: 28px;
  padding: 0 10px 0 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--button);
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
}

.daily-user-tabs button.active {
  border-color: var(--primary);
  background: #eef8f6;
  color: var(--text);
}

.daily-user-tabs button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #0b6f66;
}

.daily-user-block {
  display: grid;
  gap: 5px;
}

.daily-user-name {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.daily-task-row {
  display: grid;
  grid-template-columns: 54px repeat(3, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
}

.daily-task-row strong,
.daily-task-row span {
  min-height: 26px;
  display: flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-task-row span.done {
  border-color: #a7e0bd;
  color: var(--ok);
}

.daily-task-row span.fail {
  border-color: #f5b6bf;
  color: var(--danger);
  background: #fff1f2;
}

.module-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.module-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.top-nav [data-view-target="linkSitusView"],
.module-link-situs {
  border-color: #99d8c8;
  background: #f0fdfa;
}

.top-nav [data-view-target="utamaView"],
.module-utama {
  border-color: #adc8ff;
  background: #eff6ff;
}

.top-nav [data-view-target="naviView"],
.module-navi {
  border-color: #f4cf7b;
  background: #fffbeb;
}

.top-nav [data-view-target="csView"],
.module-cs {
  border-color: #c4b5fd;
  background: #f5f3ff;
}

.module-link-situs { box-shadow: inset 4px 0 0 #006847; }
.module-utama { box-shadow: inset 4px 0 0 #006847; }
.module-navi { box-shadow: inset 4px 0 0 #d97706; }
.module-cs { box-shadow: inset 4px 0 0 #7c3aed; }

.module-link-situs strong { color: #006847; }
.module-utama strong { color: #005238; }
.module-navi strong { color: #b45309; }
.module-cs strong { color: #6d28d9; }

.module-card div {
  display: grid;
  gap: 2px;
}

.module-card span,
.module-card p {
  color: var(--muted);
  font-size: 11px;
}

.module-card strong {
  font-size: 16px;
}

.module-card p {
  grid-column: 1 / -1;
  margin: 0;
}

.module-card button {
  min-width: 56px;
  min-height: 30px;
  padding: 0 8px;
}

.metrics div, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics div {
  padding: 10px;
}

.metrics strong {
  display: block;
  font-size: 11px;
}

.metrics span {
  color: var(--muted);
  font-size: 11px;
}

.grid {
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 10px;
  margin-bottom: 10px;
}

.panel {
  padding: 8px;
  margin-bottom: 8px;
}

.seed-table-head, .seed-row {
  display: grid;
  grid-template-columns: minmax(140px, .65fr) minmax(280px, 1.35fr) auto auto auto;
  gap: 8px;
  align-items: end;
}

.seed-table-head {
  color: var(--muted);
  font-size: 6px;
  line-height: 1;
  font-weight: 700;
  margin: 2px 0 6px;
  padding: 0 2px;
}

.seed-rows {
  display: grid;
  gap: 6px;
}

.seed-row {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.seed-row.readonly {
  grid-template-columns: minmax(140px, .65fr) minmax(280px, 1.35fr);
}

.naked-row {
  grid-template-columns: minmax(120px, .55fr) minmax(240px, 1.25fr) auto auto auto auto;
}

.naked-row.readonly {
  grid-template-columns: minmax(120px, .55fr) minmax(240px, 1.25fr) auto;
}

.seed-field {
  display: block;
  margin: 0;
}

.seed-field span {
  display: none;
  font-size: 6px;
  line-height: 1;
}

.seed-row input:disabled {
  color: var(--text);
  background: #f8fafc;
  border-color: var(--line);
  opacity: 1;
}

.seed-save,
.seed-edit,
.seed-delete {
  min-width: 52px;
  height: 30px;
}

.seed-delete {
  color: var(--danger);
}

.add-seed {
  width: 100%;
  margin-top: 8px;
}

.run-under-seeds {
  width: 100%;
  margin-top: 8px;
}

.run-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-top: 8px;
}

.run-actions .run-under-seeds,
.run-actions .pause-run {
  margin-top: 0;
  min-height: 34px;
}

.pause-run {
  min-width: 78px;
}

.naked-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.naked-head h2 {
  margin: 0;
}

.naked-actions {
  display: grid;
  grid-template-columns: minmax(112px, auto) minmax(96px, auto);
  gap: 6px;
}

.naked-auto {
  min-width: 112px;
}

.naked-pause {
  min-width: 96px;
}

.naked-pause.active {
  border-color: #f5c56b;
  background: #fff7df;
  color: #9a6700;
}

.naked-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.naked-summary div {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.naked-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.naked-summary strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.naked-open {
  min-height: 30px;
  min-width: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
}

.naked-check-details {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.naked-check-card {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.naked-check-card.ok .progress-fill { background: var(--ok); }
.naked-check-card.fail .progress-fill { background: var(--danger); }
.naked-check-card.running .progress-fill {
  background: linear-gradient(90deg, #006847, #4baf85, #006847);
  background-size: 200% 100%;
  animation: progressMove 1.1s linear infinite;
}

.naked-ok {
  margin: 6px 0 0;
  color: var(--ok);
  font-weight: 800;
}

.countdown-card,
.network-card,
.preflight-card {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.countdown-card div,
.network-card div,
.preflight-card div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.countdown-card span,
.network-card span,
.preflight-card span {
  color: var(--muted);
  font-size: 11px;
}

.countdown-card strong,
.network-card strong,
.preflight-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.network-card h3,
.preflight-card h3 {
  margin: 0;
  font-size: 11px;
}

.problem-list, .detail-list {
  display: grid;
  gap: 6px;
}

.detail-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.row strong { display: block; }
.row span { color: var(--muted); font-size: 11px; }
.tag { font-weight: 800; }
.tag.ok { color: var(--ok); }
.tag.fail { color: var(--danger); }
.tag.warn { color: var(--warn); }

.user-form {
  display: grid;
  grid-template-columns: 1fr 1fr 120px auto;
  gap: 6px;
  align-items: center;
}

select {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.language-select {
  width: auto;
  min-width: 92px;
  min-height: 32px;
  padding: 0 8px;
  background: #fbfcfe;
}

.user-list,
.log-list,
.run-history-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  max-height: 520px;
  overflow: auto;
}

.records-panel {
  min-height: 150px;
}

.records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.records-head h2 {
  margin: 0;
}

.records-head span {
  color: var(--muted);
  font-size: 10px;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 2px;
  background: var(--panel);
}

.history-summary div {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.history-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.history-summary strong {
  display: block;
  font-size: 13px;
}

.empty-state {
  min-height: 82px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
}

.empty-state strong {
  font-size: 12px;
}

.empty-state span {
  max-width: 520px;
  color: var(--muted);
  line-height: 1.45;
}

.mini-row,
.log-row {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.mini-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.user-row {
  grid-template-columns: minmax(110px, 1fr) 120px minmax(130px, 1fr) auto auto;
  align-items: center;
}

.user-row input,
.user-row select {
  min-height: 32px;
}

.user-update,
.user-delete {
  min-height: 32px;
}

.mini-row span,
.log-row span {
  color: var(--muted);
  font-size: 11px;
}

.log-row strong {
  display: block;
  font-size: 11px;
}

.log-row.warn { border-color: #f5c56b; }
.log-row.error { border-color: #fca5a5; }

.history-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(5, minmax(74px, .65fr)) repeat(4, minmax(105px, 1fr));
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
}

.history-row.warn {
  border-color: #f5c56b;
  background: #fffbeb;
}

.history-row > div:first-child {
  padding-left: 8px;
  border-left: 4px solid var(--accent);
}

.history-row.warn > div:first-child {
  border-left-color: var(--warn);
}

.domain-log-list .log-row {
  border-left: 4px solid var(--primary);
}

.domain-log-list .log-row.warn {
  border-left-color: #ce1126;
}

.history-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.history-row strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-issues {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  padding-top: 6px;
  border-top: 1px solid #f5c56b;
}

.history-issues > span {
  font-weight: 700;
  color: #9a6700;
}

.history-issue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  background: #fff7ed;
  color: #9f1239;
}

.history-issue strong,
.history-issue em,
.issue-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-issue strong,
.history-issue em {
  display: block;
}

.history-issue em {
  color: #9f1239;
  font-style: normal;
}

.seed-progress {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.seed-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.seed-head strong {
  display: block;
  overflow-wrap: anywhere;
}

.seed-head > div > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.seed-count {
  display: inline-block;
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.seed-head b {
  font-size: 11px;
}

.progress-track {
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: #006847;
  transition: width .25s ease;
}

.seed-progress.running .progress-fill {
  background: linear-gradient(90deg, #006847, #4baf85, #006847);
  background-size: 200% 100%;
  animation: progressMove 1.1s linear infinite;
}

.seed-progress.ok .progress-fill { background: var(--ok); }
.seed-progress.fail .progress-fill { background: var(--danger); }
.seed-progress.pending .progress-fill { background: #aeb7c4; }

.seed-progress.ok .seed-head b { color: var(--ok); }
.seed-progress.fail .seed-head b { color: var(--danger); }
.seed-progress.running .seed-head b { color: #006847; }
.seed-progress.pending .seed-head b { color: var(--muted); }

.seed-issues {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.seed-issue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  background: #fff1f2;
  color: #9f1239;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.seed-issue strong {
  display: block;
  color: #9f1239;
}

.seed-issue span {
  display: block;
  margin-top: 2px;
}

.copy-link {
  min-height: 26px;
  white-space: nowrap;
  border-radius: 6px;
  background: #fee2e2;
  color: #9f1239;
  padding: 0 10px;
}

.issue-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}

.history-issue-actions {
  flex-wrap: wrap;
}

.icon-link {
  width: 30px;
  height: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 0;
  background: #fee2e2;
  color: #9f1239;
  padding: 0;
  text-decoration: none;
}

.icon-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.open-link {
  background: #fff7ed;
  box-shadow: inset 0 0 0 1px #fecdd3;
}

.copy-link.copied {
  background: #dcfce7;
  color: #166534;
}

.manual-ok {
  width: auto;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

@keyframes progressMove {
  from { background-position: 0 0; }
  to { background-position: 200% 0; }
}

@media (max-width: 720px) {
  .shell {
    width: 100%;
    padding: 6px 12px;
  }
  header {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 34px;
  }
  h1 { margin-bottom: 4px; }
  .menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    min-width: 64px;
    min-height: 30px;
  }
  .toolbar { flex-direction: column; align-items: stretch; }
  .header-actions {
    display: none;
    position: absolute;
    z-index: 20;
    top: 36px;
    right: 0;
    width: min(230px, 78vw);
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
    box-shadow: 0 12px 28px rgba(16, 24, 40, .14);
  }
  .header-actions.open {
    display: grid;
    gap: 6px;
  }
  .login-top { flex-direction: column; gap: 6px; }
  .language-select { width: 100%; }
  .top-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    justify-content: stretch;
  }
  .top-nav button {
    min-width: 0;
    min-height: 32px;
    padding: 0 6px;
  }
  #logoutBtn { min-height: 32px; width: 100%; }
  .toolbar { margin-bottom: 6px; }
  .overview-hero {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 8px;
    padding: 10px;
    margin-bottom: 6px;
  }
  .overview-hero h2 { font-size: 13px; }
  .health-ring { width: 76px; }
  .health-ring::after { inset: 7px; }
  .health-ring strong { font-size: 12px; }
  .health-ring span { margin-top: 14px; font-size: 8px; }
  .overview-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 6px;
  }
  .module-results {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 6px;
  }
  .module-result {
    padding: 7px;
    border-radius: 7px;
  }
  .module-result-stats strong {
    font-size: 11px;
  }
  .intelligence-panel {
    margin-bottom: 6px;
  }
  .insight-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .insight-card {
    gap: 6px;
    padding: 7px;
    border-radius: 7px;
  }
  .insight-metrics {
    gap: 4px;
  }
  .insight-metrics span,
  .insight-reasons span,
  .insight-samples span {
    font-size: 9px;
  }
  .ai-panel {
    margin-bottom: 6px;
  }
  .ai-insight-box {
    gap: 6px;
    min-height: 36px;
    padding: 7px;
    border-radius: 7px;
  }
  .compact-button {
    min-height: 26px;
    padding: 0 8px;
    font-size: 9px;
  }
  .daily-task-list {
    max-height: 190px;
  }
  .daily-task-row {
    grid-template-columns: 42px repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  .daily-task-row strong,
  .daily-task-row span {
    min-height: 24px;
    padding: 0 5px;
    font-size: 9px;
  }
  .module-overview {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 6px;
  }
  .module-card {
    padding: 7px;
    border-radius: 7px;
  }
  .module-card strong {
    font-size: 13px;
  }
  .module-card span,
  .module-card p {
    font-size: 10px;
  }
  .module-card button {
    min-height: 28px;
  }
  .ratio-bars div {
    grid-template-columns: 62px 38px minmax(0, 1fr);
    gap: 6px;
  }
  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 6px;
  }
  .metrics div {
    min-height: 42px;
    padding: 5px;
    border-radius: 6px;
  }
  .metrics strong,
  .metrics span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .grid { grid-template-columns: 1fr; }
  .panel { padding: 7px; margin-bottom: 6px; border-radius: 7px; }
  .panel h2 { margin-bottom: 2px; }
  .user-form { grid-template-columns: 1fr; }
  .user-row {
    grid-template-columns: 1fr;
  }
  .user-update,
  .user-delete {
    width: 100%;
  }
  .seed-table-head { display: none; }
  .seed-rows { gap: 5px; }
  .seed-row {
    grid-template-columns: minmax(62px, .35fr) minmax(0, 1fr) 44px 44px 44px;
    gap: 4px;
    align-items: end;
  }
  .naked-row {
    grid-template-columns: minmax(62px, .35fr) minmax(0, 1fr) 40px 40px 40px 46px;
  }
  .seed-row.readonly {
    grid-template-columns: minmax(76px, .36fr) minmax(0, 1fr);
    gap: 5px;
    align-items: center;
    min-height: 30px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfe;
  }
  .naked-row.readonly {
    grid-template-columns: minmax(76px, .36fr) minmax(0, 1fr) 50px;
  }
  .seed-field {
    display: grid;
    gap: 2px;
    color: var(--muted);
    font-size: 6px;
    line-height: 1;
    font-weight: 700;
  }
  .seed-field span {
    display: block;
  }
  .seed-row.readonly .seed-field {
    display: grid;
    min-width: 0;
  }
  .seed-row.readonly .seed-field span {
    display: none;
  }
  .seed-row.readonly input:disabled {
    min-height: 28px;
    padding: 5px 7px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .seed-row.readonly .seed-site {
    font-weight: 700;
  }
  .seed-row.readonly .seed-domain {
    font-weight: 800;
  }
  .seed-row input { min-height: 30px; padding: 5px 7px; }
  .seed-save, .seed-edit, .seed-delete {
    width: 100%;
    min-height: 30px;
    padding: 0 4px;
  }
  .seed-save { grid-column: auto; }
  .seed-edit { grid-column: auto; }
  .seed-delete { grid-column: auto; }
  .add-seed { min-height: 34px; margin-top: 6px; }
  .add-naked { min-height: 34px; margin-top: 6px; width: 100%; }
  .run-actions { margin-top: 6px; }
  .naked-head { align-items: stretch; }
  .naked-actions {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  .naked-auto { min-width: 104px; }
  .naked-pause { min-width: 86px; }
  .naked-summary {
    gap: 5px;
    margin-bottom: 6px;
  }
  .naked-summary div {
    padding: 6px;
  }
  .naked-summary span {
    font-size: 9px;
  }
  .naked-summary strong {
    font-size: 12px;
  }
  .naked-open {
    min-width: 50px;
    min-height: 30px;
    padding: 0 4px;
  }
  .naked-check-details {
    margin-top: 6px;
  }
  .naked-check-card {
    padding: 6px;
  }
  .countdown-card, .network-card, .preflight-card { padding: 7px; gap: 5px; }
  .countdown-card div, .network-card div, .preflight-card div { grid-template-columns: 58px minmax(0, 1fr); gap: 6px; }
  .records-head { margin-bottom: 6px; }
  .history-summary { grid-template-columns: 1fr 1fr; position: static; }
  .history-row { grid-template-columns: 1fr 1fr; }
  .history-row > div:first-child { grid-column: 1 / -1; }
  .history-issue { grid-template-columns: minmax(0, 1fr) auto; }
  .seed-progress,
  .history-row,
  .log-row,
  .mini-row {
    padding: 6px;
    border-radius: 6px;
  }
  .progress-track {
    height: 6px;
    margin-top: 5px;
  }
}

/* Mexico: green, white and red */
body { background: #f4f7f5; }
.login-panel, header { border-top: 5px solid transparent; border-image: linear-gradient(90deg, #006847 0 33.33%, #fff 33.33% 66.66%, #ce1126 66.66% 100%) 1; }
.login-panel { box-shadow: 0 12px 40px #00684714; }
.overview-hero { background: linear-gradient(120deg, #004d35, #006847); }
.login-top h1::before, header h1::before { content: "🇲🇽 "; }
.language-select { min-width: 124px; }

.overview-hero h2, .overview-hero p, .overview-hero .eyebrow { color: white; }

.metrics > div { min-width: 0; }
.metrics span { white-space: normal; overflow-wrap: anywhere; }
