/* PinChat Marketing Tool — style.css */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-y: scroll; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f6f8;
  color: #222;
  font-size: 14px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-areas: "sidebar main";
  min-height: 100vh;
}

/* ── Sidebar (module switch) ─────────────── */
.sidebar {
  grid-area: sidebar;
  background: #15172b;
  color: white;
  padding: 20px 12px;
  position: sticky;
  top: 0;
  align-self: start;     /* don't stretch — sticky needs an explicit height */
  height: 100vh;
  overflow-y: auto;
  z-index: 110;
}
.sidebar-brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 10px 18px;
  color: white;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 14px;
}
.modules { display: flex; flex-direction: column; gap: 4px; }
.module-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: #c9cad6;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.module-btn:hover { background: rgba(255,255,255,0.06); color: white; }
.module-btn.active { background: #1a73e8; color: white; }

.main {
  grid-area: main;
  min-width: 0;          /* allow inner content to shrink in grid */
}

/* Mobile: stack sidebar above main */
@media (max-width: 768px) {
  body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "sidebar" "main";
  }
  .sidebar { position: relative; height: auto; padding: 10px 16px; align-self: stretch; }
  .sidebar-brand { padding: 4px 0; margin-bottom: 8px; }
  .modules { flex-direction: row; gap: 6px; }
  .module-btn { flex: 1; text-align: center; padding: 8px 10px; }
}

/* ── Header ──────────────────────────────── */
header {
  background: #1a1a2e;
  color: white;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
header h1 { font-size: 18px; font-weight: 600; flex: 1; }
header .subtitle { color: #aaa; font-size: 13px; }

/* ── Hamburger menu (header-right) ──────────── */
.header-right {
  position: relative;
  display: flex;
  align-items: center;
}
#hamburger-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}
#hamburger-btn:hover { background: rgba(255, 255, 255, 0.1); }
#hamburger-btn:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #e53935;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  border-radius: 8px;
  text-align: center;
  pointer-events: none;
}

.hamburger-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: #fff;
  color: #222;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 1100;
  overflow: hidden;
  font-size: 14px;
}
.hamburger-menu[hidden] { display: none; }

.menu-section { padding: 12px 16px; border-bottom: 1px solid #eee; }
.menu-section:last-child { border-bottom: none; }
.menu-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 6px;
}
.menu-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: none;
  font-size: 13px;
  letter-spacing: 0;
  color: #333;
  font-weight: 600;
}
.menu-actions { display: flex; gap: 12px; }
.link-btn {
  background: none;
  border: none;
  color: #1a73e8;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }
.link-btn[hidden] { display: none; }

.profile-email { color: #444; word-break: break-all; }

.notif-groups {
  max-height: 420px;
  overflow-y: auto;
}
.notif-group + .notif-group { border-top: 1px solid #eee; }
.notif-group-label {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fafafa;
  position: sticky;
  top: 0;
  z-index: 1;
}
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.notif-item {
  position: relative;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid #f3f3f3;
  cursor: default;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #f5faff; cursor: pointer; }
.notif-item.unread::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 6px;
  width: 6px;
  height: 6px;
  background: #1a73e8;
  border-radius: 50%;
}
.notif-title { font-weight: 600; color: #222; }
.notif-message { color: #555; margin-top: 2px; font-size: 13px; }
.notif-time { color: #999; margin-top: 4px; font-size: 11px; }
.notif-empty { padding: 24px 12px; text-align: center; color: #999; font-size: 13px; }

#logout-link {
  display: block;
  color: #e53935;
  text-decoration: none;
  font-weight: 500;
}
#logout-link:hover { text-decoration: underline; }

/* ── Tabs ────────────────────────────────── */
.tabs {
  display: flex;
  background: white;
  border-bottom: 2px solid #e0e0e0;
  padding: 0 16px;
  position: sticky;
  top: 42px;
  z-index: 99;
}
.tab-btn {
  padding: 12px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn:hover { color: #333; }
.tab-btn.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

/* ── Tab Content ─────────────────────────── */
.tab-content { display: none; padding: 20px 24px; }
.tab-content.active { display: block; }

/* ── Cards ───────────────────────────────── */
.card {
  background: white;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 {
  font-size: 15px;
  margin-bottom: 12px;
  color: #333;
}

/* ── Forms ───────────────────────────────── */
.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; font-weight: 600; color: #555; }
.form-group input, .form-group select, .form-group textarea {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  min-width: 200px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}

/* ── Buttons ─────────────────────────────── */
.btn {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #1a73e8; color: white; }
.btn-primary:hover:not(:disabled) { background: #1558b0; }
.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover:not(:disabled) { background: #bd2130; }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover:not(:disabled) { background: #5a6268; }
.btn-success { background: #28a745; color: white; }
.btn-success:hover:not(:disabled) { background: #218838; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Action bar ──────────────────────────── */
.action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.action-bar .count { font-size: 13px; color: #666; }

/* Normalize all interactive controls inside an action-bar to a single 30px height
   so buttons, selects, inputs, dates line up cleanly regardless of their source class. */
.action-bar > h2 { margin: 0; line-height: 30px; }
.action-bar .btn,
.action-bar .btn-sm {
  height: 30px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
}
.action-bar .btn-sm { padding: 0 10px; font-size: 12px; }
.action-bar .form-group {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
}
.action-bar .form-group label { margin: 0; }
.action-bar .form-group input,
.action-bar .form-group select,
.action-bar .form-group textarea,
.action-bar .pagination-controls select,
.action-bar .pagination-controls input[type="number"] {
  height: 30px;
  padding: 4px 10px;
  font-size: 13px;
  min-width: 0;
  box-sizing: border-box;
  line-height: 1;
}

/* ── Progress ────────────────────────────── */
.progress-box {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  font-size: 13px;
  line-height: 1.6;
}
.progress-box.visible { display: block; }
.progress-box .msg { color: #555; }
.progress-box .msg.warning { color: #e67e00; }
.progress-box .msg.error { color: #dc3545; }
.progress-box .msg.success { color: #28a745; }
.progress-box .msg.done { color: #1a73e8; font-weight: 600; }

/* ── Tables ──────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
th {
  background: #f8f9fa;
  font-weight: 600;
  color: #555;
  position: sticky;
  top: 0;
}
tr:hover { background: #f5f8ff; }
td.email { word-break: break-all; }
td.actions { white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.badge-pending { background: #fff3cd; color: #856404; }
.badge-creating { background: #cce5ff; color: #004085; }
.badge-done { background: #d4edda; color: #155724; }
.badge-failed { background: #f8d7da; color: #721c24; }
.badge-no_links { background: #e2e3e5; color: #383d41; }
.badge-needs_rescrape { background: #fff3cd; color: #856404; }
.badge-sent { background: #d4edda; color: #155724; }
.badge-skipped { background: #e2e3e5; color: #383d41; }

/* Lead pipeline status */
.lead-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status-new { background: #f0f0f0; color: #666; }
.status-no-template { background: #cce5ff; color: #004085; }
.status-ready { background: #fff3cd; color: #856404; }
.status-sent { background: #d4edda; color: #155724; }
.status-skipped { background: #e9ecef; color: #495057; }
.status-warn { background: #ffe0b2; color: #8a4b00; margin-left: 4px; }

/* Tab 2: clickable hint shown on needs_rescrape rows, in place of checkbox.
   Uses the same color as the 待重爬 badge so the visual link is obvious. */
.rescrape-link {
  font-size: 11px;
  color: #856404;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}
.rescrape-link:hover { color: #533f03; }

/* Brief background flash applied via JS to the row the operator was sent
   from, so they immediately spot it after the tab switch. */
.lead-highlight {
  background: #fff3cd !important;
  transition: background 1.5s ease-out;
}

/* ── Preview ─────────────────────────────── */
.preview-panel {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: white;
  padding: 20px;
  margin-top: 12px;
  max-height: 500px;
  overflow-y: auto;
  line-height: 1.7;
}
.preview-panel p { margin-bottom: 8px; }

/* ── Modal ───────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: white;
  border-radius: 10px;
  width: 540px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
}
.modal-header h3 { font-size: 16px; margin: 0; }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #666;
  padding: 0 4px;
  line-height: 1;
}
.modal-close:hover { color: #222; }
.modal-body {
  padding: 20px;
  overflow-y: auto;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Icon buttons ────────────────────────── */
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s;
}
.btn-icon:hover { background: #f0f0f0; }
.btn-icon.delete:hover { background: #f8d7da; }
.btn-icon.edit:hover { background: #eef3ff; }

/* ── Tag Input ───────────────────────────── */
.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 260px;
  min-height: 36px;
  cursor: text;
  align-items: center;
  background: white;
}
.tag-input-wrap:focus-within {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}
.tag-input-wrap input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 2px 4px !important;
  font-size: 14px !important;
  min-width: 100px;
  flex: 1;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #e8f0fe;
  color: #1a56cc;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.tag-chip .tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #1a56cc;
  font-size: 15px;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
  margin-left: 1px;
}
.tag-chip .tag-remove:hover { opacity: 1; }
/* Table tag list */
.tag-list { display: flex; flex-wrap: wrap; gap: 3px; }
.tag-list .tag-chip { background: #f0f4ff; color: #3d5afe; font-size: 11px; }

/* ── IMKIT 4-user expand row (Tab 2) ────── */
.btn-link-toggle {
  background: none;
  border: 1px solid #d2e3fc;
  color: #1a73e8;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-link-toggle:hover { background: #e8f0fe; }

.imkit-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  text-decoration: none;
  color: #333;
  font-size: 12px;
  transition: all 0.15s;
}
.imkit-user-chip:hover {
  border-color: #1a73e8;
  background: #f0f6ff;
  color: #1a73e8;
}
.imkit-user-key {
  display: inline-block;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #1a73e8;
  color: white;
  text-align: center;
  line-height: 18px;
  font-size: 11px;
  font-weight: 600;
}
.imkit-user-name { font-weight: 500; }
.imkit-user-role { color: #888; font-size: 11px; }

/* ── Service badges (IMKIT 服務 column) ──── */
.svc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.svc-badge + .svc-badge { margin-left: 4px; }
.svc-ios { background: #e8f0fe; color: #1a73e8; }
.svc-ios:hover { background: #d2e3fc; }
.svc-android { background: #e6f4ea; color: #137333; }
.svc-android:hover { background: #ceead6; }
.svc-web { background: #f5f5f7; color: #666; }
/* Clickable row */
tbody tr { cursor: pointer; }

/* ── Combo Select (editable dropdown) ────── */
.combo-select {
  position: relative;
}
.combo-select input {
  width: 100%;
}
.combo-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.combo-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
}
.combo-item:hover {
  background: #e8f0fe;
  color: #1a56cc;
}

/* ── Divider ─────────────────────────────── */
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  color: #999;
  font-size: 13px;
}
.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

/* ── Pagination ──────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 0 4px;
}
.pagination-bar:empty { display: none; }
.pagination-bar button {
  min-width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  transition: all 0.15s;
}
.pagination-bar button:hover:not(:disabled) { background: #f0f4ff; border-color: #1a73e8; }
.pagination-bar button.active { background: #1a73e8; color: white; border-color: #1a73e8; }
.pagination-bar button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-bar .page-info { font-size: 13px; color: #666; margin: 0 8px; }
.pagination-controls { display: inline-flex; align-items: center; gap: 6px; }
.pagination-controls select,
.pagination-controls input[type="number"] {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  height: 30px;
  box-sizing: border-box;
}
.pagination-controls input[type="number"] { width: 80px; }

/* ── Sortable headers ───────────────────── */
th[data-sort]::after { content: ''; margin-left: 4px; }
th[data-sort="asc"]::after { content: ' ▲'; font-size: 10px; }
th[data-sort="desc"]::after { content: ' ▼'; font-size: 10px; }

/* ── Empty state ─────────────────────────── */
.empty {
  text-align: center;
  padding: 40px;
  color: #999;
}

/* ── Stats (Tab 5) ───────────────────────── */
.stats-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.stats-range { display: flex; align-items: center; gap: 6px; color: #555; flex-wrap: wrap; }
.range-btn { background: #fff; border: 1px solid #dadce0; color: #444; }
.range-btn.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.stats-range .range-divider { width: 1px; height: 20px; background: #e0e0e0; margin: 0 8px; }
.stats-range input[type="date"] {
  height: 26px;
  padding: 2px 8px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #444;
  line-height: 1;
}
.stats-range input[type="date"]:focus { outline: none; border-color: #1a73e8; }
.stats-meta { margin-top: 10px; font-size: 12px; color: #777; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.kpi-card {
  background: #f8f9fb;
  border: 1px solid #e0e3e8;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 84px;
}
.kpi-label { font-size: 12px; color: #666; margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 600; color: #1a1a2e; line-height: 1.1; }
.kpi-sub { font-size: 11px; color: #888; margin-top: 4px; }
.kpi-section-label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.stats-row .card { margin-bottom: 0; }
.chart-wrap {
  position: relative;
  height: 300px;
  width: 100%;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.stats-table th, .stats-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.stats-table th { color: #666; font-weight: 500; background: #fafbfc; }

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .form-row { flex-direction: column; }
  .form-group input { min-width: 100%; }
  .tabs { overflow-x: auto; }
  .tab-btn { white-space: nowrap; padding: 10px 14px; }
  .stats-row { grid-template-columns: 1fr; }
}

.kpi-sub { font-size: 12px; color: #666; margin-top: 4px; }

table.sortable thead th[data-sort] { cursor: pointer; user-select: none; }
table.sortable thead th[data-sort]:hover { background: #f0f0f5; }
table.sortable thead th.sort-asc::after  { content: ' ▲'; color: #666; font-size: 11px; }
table.sortable thead th.sort-desc::after { content: ' ▼'; color: #666; font-size: 11px; }

/* ── Search queue panel ──────────────────── */
.queue-panel { margin-top: 16px; }
.queue-header {
  display: flex; align-items: baseline; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid #e8eaf0; margin-bottom: 8px;
}
.queue-title { font-size: 14px; font-weight: 600; color: #333; }
.queue-hint { font-size: 12px; color: #888; }
.queue-row {
  display: grid;
  grid-template-columns: 70px 1fr 110px 90px 120px;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid #f2f3f5;
  align-items: center;
  font-size: 13px;
}
.queue-row .q-actions { display: flex; gap: 4px; justify-content: flex-end; }
.queue-row:last-child { border-bottom: none; }
.queue-row .q-time { color: #999; font-size: 12px; }
.queue-row .q-query { color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-row .q-count { color: #333; font-size: 13px; text-align: right; }
.queue-row .q-count strong { color: #1a73e8; }
.queue-row .q-actions { text-align: right; }
.queue-row .q-actions .btn { padding: 2px 8px; font-size: 11px; }
.queue-empty { color: #999; font-size: 13px; padding: 12px; text-align: center; }

/* status badges */
.q-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; display: inline-block; font-weight: 500; }
.q-badge-queued { background: #eef0f4; color: #666; }
.q-badge-running { background: #e8f0fe; color: #1a73e8; }
.q-badge-running::before { content: '● '; color: #1a73e8; animation: pulse 1.5s infinite; }
.q-badge-done { background: #e6f4ea; color: #137333; }
.q-badge-failed { background: #fce8e6; color: #c5221f; }
.q-badge-cancelled { background: #fef7e0; color: #a87900; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.restart-banner {
  background: #fff3cd;
  color: #856404;
  border-bottom: 1px solid #ffeeba;
  padding: 10px 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.restart-banner .banner-close {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}
.restart-banner .banner-close:hover { opacity: 0.7; }

/* Stale-progress warning row inside progress boxes */
.progress-stale {
  color: #a87900;
  background: #fef7e0;
  padding: 6px 8px;
  border-left: 3px solid #f9ab00;
  margin: 4px 0;
  font-size: 13px;
}

