body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  color: #111827;
}

.help-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #111827;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.25);
  z-index: 20;
}

.help-fab:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.ms-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 24px;
  background: #111827;
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ms-header h1 {
  margin: 0;
  font-size: 20px;
}

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

.ms-nav {
  display: flex;
  gap: 8px;
  margin-right: 8px;
}

.ms-nav a {
  font-size: 13px;
  color: #e5e7eb;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.ms-nav a:hover {
  border-color: #9ca3af;
  background: #1f2937;
}

.ms-filters label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
}

.ms-filters select,
.ms-filters input {
  min-width: 160px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  font-size: 13px;
}

.ms-filters #reloadBtn,
.ms-filters #checkBtn,
.ms-filters #exportBtn {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #4b5563;
  background: #1f2937;
  color: #f9fafb;
  cursor: pointer;
  font-size: 13px;
}

.ms-filters #reloadBtn:hover,
.ms-filters #checkBtn:hover,
.ms-filters #exportBtn:hover {
  background: #374151;
}

.ms-filters #exportBtn {
  background: #059669;
  border-color: #047857;
}

.ms-filters #exportBtn:hover {
  background: #047857;
}

main {
  padding: 16px 24px;
}

.ms-summary-bar {
  margin-bottom: 10px;
  font-size: 13px;
  color: #374151;
}

.ms-summary-bar span {
  display: inline-block;
  margin-right: 10px;
}

.ms-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.ms-table thead {
  background: #f3f4f6;
}

.ms-table th,
.ms-table td {
  padding: 8px 10px;
  font-size: 13px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

/* Column widths: SN, Name, OldURL, PageType, Type, Category, New URL, Status, Notes */

/* SN column - very narrow for running numbers */
.ms-table th:nth-child(1),
.ms-table td:nth-child(1) {
  width: 2.5%;
  min-width: 35px;
  text-align: center;
}

/* Name column */
.ms-table th:nth-child(2),
.ms-table td:nth-child(2) {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
  word-wrap: break-word;
  white-space: normal;
}

/* OldURL column - more space for URLs */
.ms-table th:nth-child(3),
.ms-table td:nth-child(3) {
  width: 20%;
  min-width: 150px;
  word-break: break-all;
}

/* PageType column - narrow */
.ms-table th:nth-child(4),
.ms-table td:nth-child(4) {
  width: 6%;
  min-width: 60px;
}

/* Type column (Dynamic/Static) - narrow */
.ms-table th:nth-child(5),
.ms-table td:nth-child(5) {
  width: 5%;
  min-width: 50px;
  text-align: center;
}

/* Category column - narrow */
.ms-table th:nth-child(6),
.ms-table td:nth-child(6) {
  width: 6%;
  min-width: 55px;
  text-align: center;
}

/* New URL column - widest for editing */
.ms-table th:nth-child(7),
.ms-table td:nth-child(7) {
  width: 28%;
  min-width: 200px;
}

/* Status column */
.ms-table th:nth-child(8),
.ms-table td:nth-child(8) {
  width: 10%;
  min-width: 100px;
}

/* Notes column */
.ms-table th:nth-child(9),
.ms-table td:nth-child(9) {
  width: 14.5%;
  min-width: 120px;
}

.ms-table th {
  text-align: left;
  font-weight: 600;
  color: #4b5563;
}

.ms-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.ms-status-select {
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  font-size: 12px;
}

.ms-notes-input {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  font-size: 12px;
}

.ms-status-bar {
  margin-top: 10px;
  font-size: 12px;
  color: #4b5563;
}

.ms-status-bar--success {
  color: #065f46;
}

.ms-status-bar--error {
  color: #b91c1c;
}

/* Row / status colors */

.ms-row--pending .ms-status-select {
  background-color: #fef9c3;
  border-color: #eab308;
}

.ms-row--migrated .ms-status-select {
  background-color: #bbf7d0; /* darker green tone */
  border-color: #15803d;
}

.ms-row--remove .ms-status-select {
  background-color: #fee2e2;
  border-color: #dc2626;
}

.ms-row--redirect .ms-status-select {
  background-color: #e0f2fe;
  border-color: #0284c7;
}

.ms-row--not-in-scope .ms-status-select {
  background-color: #e5e7eb;
  border-color: #6b7280;
}

.ms-row--verified .ms-status-select {
  background-color: #dcfce7; /* lighter green */
  border-color: #16a34a;
}

.ms-row--needs-review .ms-status-select {
  background-color: #fae8ff;
  border-color: #a855f7;
}

/* HTTP status code rows */
.ms-row--404 .ms-status-select,
.ms-row--401 .ms-status-select,
.ms-row--402 .ms-status-select,
.ms-row--403 .ms-status-select {
  background-color: #fecaca;
  border-color: #dc2626;
  color: #7f1d1d;
  font-weight: 600;
}

.ms-row--500 .ms-status-select,
.ms-row--502 .ms-status-select,
.ms-row--503 .ms-status-select {
  background-color: #fed7aa;
  border-color: #ea580c;
  color: #7c2d12;
  font-weight: 600;
}

/* Spinner animation for loading states */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
