/* keywords.css — scoped to .kw-body, no conflicts with gamine-portal.css */

body.kw-body {
  background: #F6E8D8;
  min-height: 100vh;
}

/* Topbar: wider gap for extra buttons */
.kw-topbar { gap: 12px; }

/* Run Now button */
.kw-run-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: #FF7A45;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.kw-run-btn:hover    { background: #E85E2E; }
.kw-run-btn:disabled { opacity: 0.6; cursor: wait; }

/* Hero */
.kw-hero     { max-width: 1080px; margin: 0 auto; padding: 32px 32px 16px; }
.kw-title    { font-family: "Playfair Display", serif; font-size: 36px; color: #9B4A2B; margin: 0 0 4px; }
.kw-subtitle { font-family: "Montserrat", sans-serif; font-size: 14px; color: #6B7280; margin: 0; }

/* Flash messages */
.kw-flash {
  max-width: 1080px;
  margin: 0 auto 12px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
}
.kw-flash--success { background: #d4f0d4; color: #1a6b1a; }
.kw-flash--error   { background: #fde8e8; color: #9b2b2b; }

/* Add form */
.kw-add-form { max-width: 1080px; margin: 0 auto 24px; padding: 0 32px; }
.kw-add-row  {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.7);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(232,226,216,0.9);
}
.kw-add-input {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  border: 1px solid #E8E2D8;
  border-radius: 8px;
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  background: #fff;
  outline: none;
}
.kw-add-input:focus { border-color: #FF7A45; }

.kw-networks { display: flex; gap: 6px; }

.kw-net-toggle {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 700;
  user-select: none;
  transition: all 0.15s;
}
.kw-net-toggle--on  { background: #FF7A45; color: #fff; }
.kw-net-toggle--off { background: #E8E2D8; color: #6B7280; }

.kw-add-btn {
  padding: 8px 16px;
  background: #9B4A2B;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.kw-add-btn:hover { background: #7a3820; }

/* Table */
.kw-main       { max-width: 1100px; margin: 0 auto; padding: 0 32px 80px; }
.kw-table-wrap {
  border-radius: 12px;
  border: 1px solid rgba(232,226,216,0.9);
  background: rgba(255,255,255,0.75);
}
.kw-table { width: 100%; border-collapse: collapse; font-family: "Montserrat", sans-serif; font-size: 12px; }

.kw-table thead th {
  padding: 10px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6B7280;
  border-bottom: 1px solid #E8E2D8;
  white-space: nowrap;
  background: rgba(246,232,216,0.5);
}
.kw-table thead th.sortable { cursor: pointer; }
.kw-table thead th.sortable:hover { color: #FF7A45; }
.sort-icon { color: #9B4A2B; font-size: 10px; margin-left: 2px; }

.kw-table tbody tr {
  border-bottom: 1px solid rgba(232,226,216,0.5);
  transition: background 0.1s;
}
.kw-table tbody tr:hover       { background: rgba(255,122,69,0.04); }
.kw-table tbody tr:last-child  { border-bottom: none; }
.kw-table td { padding: 7px 10px; vertical-align: middle; color: #111827; }

.kw-row--inactive td { opacity: 0.45; }

.kw-cell-keyword { font-weight: 600; }
.kw-cell-date    { color: #6B7280; font-size: 11px; white-space: nowrap; }
.kw-edited       { color: #9B4A2B; font-size: 10px; font-style: italic; }
.kw-cell-num     { color: #6B7280; text-align: right; white-space: nowrap; }

.kw-edit-input {
  width: 130px;
  padding: 3px 7px;
  border: 1px solid #FF7A45;
  border-radius: 6px;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  background: #fff;
}

/* Master network toggles in table header */
.kw-net-all-row {
  display: flex;
  gap: 3px;
  margin-top: 5px;
}
.kw-net-all-btn {
  border: 1px solid #9B4A2B;
  border-radius: 4px;
  background: transparent;
  color: #9B4A2B;
  font-family: "Montserrat", sans-serif;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.15s;
}
.kw-net-all-btn:hover { background: #9B4A2B; color: #fff; }

/* Network pills — grouped in one cell */
.kw-net-cell  { white-space: nowrap; }
.kw-net-pills { display: flex; gap: 3px; }
.kw-net-pill {
  border: none;
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.kw-net-pill--on  { background: #FF7A45; color: #fff; }
.kw-net-pill--off { background: #E8E2D8; color: #9B8C80; }
.kw-net-pill:hover { filter: brightness(0.9); }

/* Action buttons — combined in one cell */
.kw-actions-cell       { white-space: nowrap; }
.kw-actions-cell form  { display: inline; margin: 0; }
.kw-action-btn {
  border: none;
  border-radius: 5px;
  font-family: "Montserrat", sans-serif;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  margin-right: 2px;
}
.kw-action-btn--deactivate          { background: #fde8c8; color: #9B4A2B; }
.kw-action-btn--deactivate:hover    { background: #fbcf99; }
.kw-action-btn--activate            { background: #d4f0d4; color: #1a6b1a; }
.kw-action-btn--activate:hover      { background: #b6e6b6; }
.kw-action-btn--delete              { background: #fde8e8; color: #9b2b2b; }
.kw-action-btn--delete:hover        { background: #fcc8c8; }
.kw-action-btn--edit                { background: #e8e2f8; color: #4a2b9b; }
.kw-action-btn--edit:hover          { background: #d0c8f0; }

/* Run stats pills */
.kw-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff8f5;
  border: 1px solid #f0d5c8;
  border-radius: 20px;
  padding: 5px 14px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.72rem;
  color: #9B4A2B;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}
.kw-stat-label { font-weight: 500; opacity: 0.75; }
.kw-stat-value { font-weight: 700; }

/* Mobile */
@media (max-width: 860px) {
  .kw-hero     { padding: 20px 16px 12px; }
  .kw-add-form { padding: 0 16px; }
  .kw-main     { padding: 0 16px 80px; }
  .kw-title    { font-size: 26px; }
}
