/* ==========================================================================
   Typography & Local Web Fonts: Rubik
   ========================================================================== */
@font-face {
  font-family: 'Rubik';
  src: local('Rubik'),
       url('/fonts/Rubik-VariableFont_wght.ttf') format('truetype-variations'),
       url('/fonts/Rubik-VariableFont_wght.ttf') format('truetype');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rubik';
  src: local('Rubik Italic'),
       url('/fonts/Rubik-Italic-VariableFont_wght.ttf') format('truetype-variations'),
       url('/fonts/Rubik-Italic-VariableFont_wght.ttf') format('truetype');
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

/* Static fallbacks for older web engines */
@font-face {
  font-family: 'Rubik';
  src: url('/fonts/static/Rubik-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rubik';
  src: url('/fonts/static/Rubik-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rubik';
  src: url('/fonts/static/Rubik-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rubik';
  src: url('/fonts/static/Rubik-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rubik';
  src: url('/fonts/static/Rubik-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rubik';
  src: url('/fonts/static/Rubik-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Rubik';
  src: url('/fonts/static/Rubik-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: 'Rubik', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --bg: #0B141A;
  --bg-gradient: radial-gradient(circle at top right, #111B21 0%, #0B141A 65%);
  --panel: #111B21;
  --card: #1F2C34;
  --card2: #23323B;
  --line: #2A3942;
  --line-subtle: #202C33;
  --txt: #E9EDEF;
  --muted: #8696A0;
  --muted2: #667781;
  --primary: #00A884;
  --accent: #25D366;
  --accent-glow: rgba(37, 211, 102, 0.35);
  --accent-glow-subtle: rgba(0, 168, 132, 0.25);
  --secondary: #128C7E;
  --danger: #EF4444;
  --danger-bg: #3B1C22;
  --warning: #F59E0B;
  --blue: #38BDF8;
}

* {
  box-sizing: border-box;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Custom Scrollbar per DESIGN.md Cyber Dark standard */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0B141A;
}
::-webkit-scrollbar-thumb {
  background: #2A3942;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00A884;
}

/* Beacon Pulse Keyframe per DESIGN.md */
@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.6);
    opacity: 0.2;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}
.beacon-pulse {
  animation: pulse-ring 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.header-main-logo {
  height: 48px;
  max-width: 230px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(37, 211, 102, 0.28));
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s ease;
  display: block;
}
.header-main-logo:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 0 18px rgba(37, 211, 102, 0.5));
}

.header-app-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 0 16px -2px rgba(37, 211, 102, 0.45);
  border: 1px solid rgba(0, 168, 132, 0.4);
  background: #0B141A;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
  flex-shrink: 0;
}
.header-app-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 0 22px rgba(37, 211, 102, 0.65);
}

.logo-hub {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(37, 211, 102, 0.45);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-text-block h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #E9EDEF;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.brand-text-block p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
}

.drawer-app-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 0 12px -2px rgba(37, 211, 102, 0.35);
  border: 1px solid rgba(0, 168, 132, 0.35);
  background: #0B141A;
  flex-shrink: 0;
}

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--txt);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Ensure consistent font inheritance across all interactive & input controls */
button,
input,
optgroup,
select,
textarea,
dialog,
table,
th,
td,
.button-link {
  font-family: inherit;
  letter-spacing: normal;
}

h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  letter-spacing: normal;
}

.app {
  max-width: 1040px;
  margin: auto;
  padding: 16px 14px 80px;
}

header,
.title,
.row,
.actions,
.account-top,
.account-name,
.account-actions,
.account-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

header {
  padding: 18px 20px;
  background: rgba(14, 30, 26, 0.75);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

header:hover {
  border-color: rgba(37, 211, 102, 0.3);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.burger-btn {
  display: none; /* Hidden on desktop: only shown on mobile/tablet */
  align-items: center;
  gap: 10px;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--txt);
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 44px;
  flex-shrink: 0;
}

.burger-btn:hover {
  background: #18372e;
  border-color: rgba(37, 211, 102, 0.4);
  transform: translateY(-1px);
}

.burger-btn:active {
  transform: translateY(1px) scale(0.98);
}

.burger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 20px;
  height: 15px;
  flex-shrink: 0;
}

.burger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.burger-label {
  font-size: 13.5px;
  font-weight: 700;
  color: #effff8;
}

.header-logo {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(37, 211, 102, 0.5));
}

.header-badge {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.15);
  color: var(--accent);
  border: 1px solid rgba(37, 211, 102, 0.3);
  margin-inline-start: 8px;
  vertical-align: middle;
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}

h3 {
  margin: 14px 0 8px;
  font-size: 15px;
  font-weight: 700;
}

p {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 14px;
}

button,
.button-link {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--txt);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

button:hover:not(:disabled),
.button-link:hover {
  background: #18372e;
  border-color: rgba(37, 211, 102, 0.4);
  transform: translateY(-1px);
}

button:active:not(:disabled),
.button-link:active {
  transform: translateY(1px) scale(0.99);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none !important;
}

.primary {
  background: linear-gradient(135deg, #25d366 0%, #1ea952 100%);
  color: #031a0d;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.primary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.38);
}

.secondary {
  background: var(--card2);
  border-color: var(--line);
}

.danger {
  background: var(--danger-bg);
  color: #fecaca;
  border-color: #6d2831;
}

.danger:hover:not(:disabled) {
  background: #541d24;
  border-color: #8c3b47;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
  animation: tabFadeIn 0.2s ease-out;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.grid {
  display: grid;
  gap: 10px
}

.cards {
  grid-template-columns: repeat(3, 1fr)
}

.two {
  grid-template-columns: 1fr 1fr
}

.card b {
  display: block;
  font-size: 28px;
  margin-top: 6px
}

input,
textarea,
select {
  width: 100%;
  background: #091714;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
  background: #0d221d;
  outline: none;
}

textarea {
  min-height: 110px;
  margin: 8px 0;
  resize: vertical;
}

.row input {
  flex: 1;
  min-width: 180px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pill.ok {
  background: rgba(37, 211, 102, 0.15);
  color: #a7f3d0;
  border-color: rgba(37, 211, 102, 0.35);
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.12);
}

.pill.off {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}

.item {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.notice {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(14, 30, 26, 0.6);
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}

label {
  display: block;
  padding: 8px 0 4px;
  font-weight: 600;
  font-size: 14px;
  color: #d1fae5;
}

dialog {
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: 20px;
  background: var(--card);
  color: var(--txt);
  font-family: inherit;
  width: min(94%, 500px);
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

#publishJobEditDialog,
#directJoinEditDialog {
  width: min(94%, 560px);
  max-height: 90vh;
  overflow-y: auto;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog[open] {
  animation: dialogFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dialogFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(3, 10, 8, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.account-legend {
  justify-content: flex-start;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.account-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
  position: relative;
  flex-shrink: 0;
}

.status-dot.connected {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  animation: pulse-ring 2.2s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #777;
  box-shadow: 0 0 0 3px #ffffff0a
}

.status-dot.connected {
  background: var(--blue)
}

.status-dot.offline,
.status-dot.logged_out {
  background: var(--danger)
}

.status-dot.waiting_qr {
  background: var(--yellow)
}

.status-dot.connecting {
  background: #a78bfa
}

.account-card {
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  margin-top: 10px
}

.account-top {
  align-items: flex-start
}

.account-name {
  justify-content: flex-start;
  flex-wrap: nowrap
}

.account-name strong {
  font-size: 17px
}

.state-chip {
  font-size: 12px;
  border: 1px solid var(--line);
  padding: 5px 9px;
  border-radius: 999px
}

.state-chip.connected {
  color: #b9d5ff;
  background: #14325b
}

.state-chip.offline,
.state-chip.logged_out {
  color: #ffc0c5;
  background: #49242a
}

.state-chip.waiting_qr {
  color: #ffe9a9;
  background: #4d401e
}

.state-chip.connecting {
  color: #ddd2ff;
  background: #352b55
}

.account-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  margin: 10px 0
}

.error-text {
  color: #ff9ba3
}

.account-actions {
  justify-content: flex-start
}

.account-actions button {
  font-size: 12px;
  padding: 8px 10px
}

.empty-state {
  text-align: center;
  padding: 25px 10px
}

.empty-state b {
  font-size: 18px
}

.qr-wrap {
  text-align: center
}

.qr-box {
  background: white;
  border-radius: 14px;
  padding: 10px;
  margin: 12px auto;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center
}

.qr-box img {
  width: min(100%, 390px);
  height: auto;
  display: block
}

.qr-wrap .actions {
  justify-content: center
}

@media(max-width:650px) {

  .cards,
  .two {
    grid-template-columns: 1fr
  }

  nav {
    flex-wrap: wrap
  }

  .app {
    padding: 10px
  }

  .account-actions button {
    flex: 1 1 45%
  }
}

.monitor-box {
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  margin: 12px 0
}

.monitor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 8px
}

.switch-line input,
.group-option input {
  width: 20px;
  height: 20px
}

.groups-chooser {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
  margin: 10px 0;
  padding: 4px
}

.groups-chooser.disabled {
  opacity: .45
}

.group-option {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #081a16;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px
}

.group-option span {
  display: flex;
  flex-direction: column
}

.group-option b {
  font-size: 14px
}

.group-option small {
  color: var(--muted)
}

.title.sub {
  margin-top: 18px
}

.search-input {
  max-width: 360px
}

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

.count-chip {
  font-size: 12px;
  background: #183b31;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px
}

.url-line {
  direction: ltr;
  text-align: left;
  word-break: break-all;
  margin: 5px 0;
  color: #d7fff0
}

/* ==========================================================================
   Extracted Links Table (صفحة المراقبة)
   ========================================================================== */
.links-table-wrap {
  margin-top: 14px;
  max-height: 520px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
}

.links-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: right;
  font-size: 13px;
}

.links-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.links-table th {
  background: var(--card2);
  color: var(--txt);
  padding: 11px 12px;
  font-weight: 700;
  font-size: 12px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.links-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  line-height: 1.4;
  font-size: 13px;
}

.links-table tbody tr:hover td {
  background: rgba(37, 211, 102, 0.04);
}

.links-table tbody tr:last-child td {
  border-bottom: none;
}

.link-cell-id {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.link-cell-type {
  text-align: center;
  white-space: nowrap;
}

.link-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.link-type-badge.type-whatsapp {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.3);
}

.link-type-badge.type-telegram {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.link-type-badge.type-web {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.3);
}

.link-type-badge.type-other {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.25);
}

.link-cell-url {
  max-width: 340px;
}

.extracted-link-pill {
  color: #38bdf8;
  text-decoration: none;
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 4px 9px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  transition: all 0.15s ease;
  word-break: break-all;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: left;
}

.extracted-link-pill:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
}

.link-cell-source {
  max-width: 220px;
}

.link-source-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.link-group-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.link-source-info small {
  font-size: 11.5px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.link-cell-occurrences {
  text-align: center;
  white-space: nowrap;
}

.link-cell-occurrences .count-chip {
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 211, 102, 0.12);
  color: #34d399;
  border: 1px solid rgba(37, 211, 102, 0.28);
}

.link-cell-time {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.links-empty-state {
  text-align: center;
  padding: 30px 16px;
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--line);
  margin-top: 12px;
}

.source-actions,
.source-tools,
.source-summary,
.source-card-head,
.source-meta,
.category-editor {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap
}

.source-tools {
  margin: 12px 0
}

.source-tools .search-input {
  flex: 1;
  min-width: 220px
}

.source-tools select {
  max-width: 230px
}

.source-summary {
  margin: 8px 0 14px;
  color: var(--muted)
}

.source-summary span {
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px
}

.source-summary b {
  display: inline;
  font-size: inherit;
  margin: 0;
  color: var(--txt)
}

.source-card {
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  margin: 10px 0
}

.source-card-head {
  justify-content: space-between;
  align-items: flex-start
}

.source-card-head b {
  font-size: 16px
}

.confidence-chip {
  font-size: 12px;
  border: 1px solid var(--line);
  background: #17362d;
  border-radius: 999px;
  padding: 5px 9px
}

.source-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0
}

.category-editor {
  margin-top: 10px
}

.category-editor select {
  flex: 1;
  min-width: 180px
}

.source-card details {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px
}

.source-card summary {
  cursor: pointer;
  color: var(--muted)
}

.source-list {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted)
}

@media(max-width:650px) {
  .source-tools select {
    max-width: none
  }

  .category-editor button {
    width: 100%
  }
}

.export-box {
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  margin: 14px 0
}

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

.export-status span {
  background: #081a16;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  color: var(--muted);
  font-size: 12px
}

.export-status b {
  display: block;
  color: var(--txt);
  font-size: 16px;
  margin-top: 4px
}

.export-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

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

.export-section-head b {
  font-size: 14.5px;
  color: #f1f5f9;
}

.export-section-head .muted {
  font-size: 12px;
}

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

.export-card-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  min-height: 52px;
  border-radius: 12px;
  background: rgba(14, 42, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: right;
  width: 100%;
}

.export-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.export-card-btn.export-excel {
  border-color: rgba(37, 211, 102, 0.25);
  background: rgba(18, 50, 40, 0.55);
}

.export-card-btn.export-excel:hover {
  background: rgba(22, 65, 52, 0.85);
  border-color: rgba(37, 211, 102, 0.5);
}

.export-card-btn.export-csv {
  border-color: rgba(56, 189, 248, 0.2);
  background: rgba(15, 35, 45, 0.55);
}

.export-card-btn.export-csv:hover {
  background: rgba(18, 48, 62, 0.85);
  border-color: rgba(56, 189, 248, 0.45);
}

.export-btn-icon {
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.export-btn-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.export-btn-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
}

.export-btn-sub {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

.export-reset-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(64, 24, 29, 0.22);
  border: 1px dashed rgba(248, 113, 113, 0.28);
  border-radius: 12px;
}

.export-reset-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 200px;
}

.export-reset-info .reset-title {
  font-size: 13px;
  font-weight: 700;
  color: #fca5a5;
}

.export-reset-info .muted {
  font-size: 11.5px;
  color: #94a3b8;
}

.export-reset-action {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 9px;
  white-space: nowrap;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  transition: all 0.2s ease;
}

.export-reset-action:hover {
  background: rgba(248, 113, 113, 0.3);
  border-color: #f87171;
  color: #fff;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .export-grid-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .export-status {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .export-grid-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .export-card-btn {
    padding: 8px 10px;
    gap: 7px;
  }
  .export-btn-icon {
    font-size: 18px;
  }
  .export-btn-title {
    font-size: 12.5px;
  }
  .export-btn-sub {
    font-size: 10.5px;
  }
  .export-reset-container {
    flex-direction: column;
    align-items: stretch;
  }
  .export-reset-action {
    width: 100%;
    text-align: center;
  }
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 10px 0 16px
}

.settings-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr))
}

.setting-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px
}

.setting-card input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto
}

.setting-card span {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.setting-card b {
  font-size: 14px
}

.setting-card small {
  color: var(--muted);
  line-height: 1.5
}

.settings-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px
}

.account-monitor-list {
  display: grid;
  gap: 8px
}

.account-monitor-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px
}

.account-monitor-card b {
  font-size: 15px
}

.mini-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0
}

.mini-switch input {
  width: 22px;
  height: 22px
}

.mini-switch span {
  color: var(--muted);
  font-size: 12px
}

@media(max-width:650px) {

  .settings-grid,
  .settings-grid.compact {
    grid-template-columns: 1fr
  }

  .account-monitor-card {
    align-items: flex-start
  }
}


.inspector-form {
  display: grid;
  gap: 8px
}

.inspect-import-actions,
.batch-actions,
.inspection-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap
}

.inspect-account-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap
}

.inspect-account-presets {
  display: flex;
  gap: 7px;
  flex-wrap: wrap
}

.inspect-account-presets button {
  min-width: 52px
}

.inspect-account-presets button.active {
  border-color: var(--accent);
  background: #123827
}

.inspect-import-actions input[type=file] {
  flex: 1;
  min-width: 220px
}

.btn-filter-groups {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 211, 102, 0.12);
  color: #38e17b;
  border: 1px solid rgba(37, 211, 102, 0.35);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-filter-groups:hover {
  background: rgba(37, 211, 102, 0.22);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.filter-result-notice {
  margin-top: 10px;
  margin-bottom: 6px;
  border-radius: 12px;
  animation: fadeIn 0.25s ease;
}

.filter-stat-box {
  background: #0f241d;
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-stat-title {
  font-size: 14px;
  color: var(--txt);
}

.filter-stat-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.pill-chip.skipped {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.pill-chip.new {
  background: rgba(37, 211, 102, 0.18);
  color: #38e17b;
  border: 1px solid rgba(37, 211, 102, 0.4);
}

.pill-chip.neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border: 1px solid var(--line);
}

.filter-excluded-details {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.filter-excluded-details summary {
  cursor: pointer;
  color: #fbbf24;
  font-weight: 600;
  user-select: none;
}

.filter-excluded-details ul {
  margin: 8px 0 0;
  padding-inline-start: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}

.filter-excluded-details li {
  color: var(--txt);
  word-break: break-all;
}

.btn-text-revert {
  background: transparent;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12.5px;
}

.btn-text-revert:hover {
  color: var(--txt);
}

.direct-join-links-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(17, 27, 33, 0.9);
  border: 1px solid var(--line, #2a3942);
  border-radius: 10px;
  padding: 8px 14px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted, #8696a0);
  animation: fadeIn 0.2s ease;
}

.direct-join-meta-counts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.direct-join-meta-counts .meta-item strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-inline-start: 4px;
}

.direct-join-meta-counts .meta-unique strong {
  color: #25d366;
  font-weight: 700;
}

.meta-separator {
  color: rgba(255, 255, 255, 0.2);
}

.meta-badge-dup {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 600;
}

.btn-clean-links {
  background: rgba(37, 211, 102, 0.12) !important;
  border-color: rgba(37, 211, 102, 0.35) !important;
  color: #25d366 !important;
  font-weight: 600;
}

.btn-clean-links:hover {
  background: rgba(37, 211, 102, 0.22) !important;
  border-color: rgba(37, 211, 102, 0.6) !important;
}

.direct-join-options {
  margin: 6px 0 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--txt);
}

.checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

.delay-range-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.delay-range-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card2);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 10px;
  flex: 1;
  min-width: 140px;
}

.delay-range-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.delay-range-box input[type="number"] {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--txt);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  padding: 4px 0;
}

.delay-range-box input[type="number"]:focus {
  outline: none;
}

.delay-range-unit {
  font-size: 12.5px;
  color: var(--muted);
}

.delay-range-dash {
  font-size: 18px;
  font-weight: 800;
  color: var(--muted);
}

.range-hint {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 6px;
}

.job-delay-range-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.delay-range-inline-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--txt);
}

.delay-range-inline-label input[type="number"] {
  width: 62px;
  padding: 4px 6px;
  font-size: 13px;
  text-align: center;
}

/* Direct Join Job Card enhancements */
.direct-join-card {
  background: rgba(8, 26, 22, 0.85);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.direct-join-card:hover {
  border-color: rgba(37, 211, 102, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.direct-join-card .inspection-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.direct-join-card .inspection-head b {
  font-size: 15px;
  color: #f1f5f9;
}

.direct-join-card .inspection-counts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 14px;
}

.publish-job-card .inspection-counts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.direct-join-card .inspection-counts span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(14, 42, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 9px 6px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  gap: 3px;
  transition: all 0.2s ease;
}

.direct-join-card .inspection-counts span:hover {
  background: rgba(14, 42, 34, 0.9);
  border-color: rgba(37, 211, 102, 0.35);
}

.direct-join-card .inspection-counts span b {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.direct-join-card .inspection-counts .stat-joined b { color: #34d399; }
.direct-join-card .inspection-counts .stat-skipped b { color: #fbbf24; }
.direct-join-card .inspection-counts .stat-failed b { color: #f87171; }
.direct-join-card .inspection-counts .stat-pending b { color: #38bdf8; }
.direct-join-card .inspection-counts .stat-total b { color: #f1f5f9; }

@media (max-width: 768px) {
  .direct-join-card .inspection-counts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .direct-join-card .inspection-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.direct-join-card .batch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
}

.job-buttons-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.job-buttons-group button,
.direct-join-card button {
  min-height: 34px;
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 9px;
}

.current-delay-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(37, 211, 102, 0.12);
  color: #34d399;
  border: 1px solid rgba(37, 211, 102, 0.28);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* State Chips for Jobs (Matching Image 1 & 2 layout) */
.state-chip-job {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.2px;
}
.state-chip-job.running {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.45);
  color: #34d399;
}
.state-chip-job.scheduled {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(129, 140, 248, 0.45);
  color: #a5b4fc;
}
.state-chip-job.paused {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fbbf24;
}
.state-chip-job.completed {
  background: rgba(20, 50, 91, 0.6);
  border-color: rgba(56, 189, 248, 0.4);
  color: #b9d5ff;
}
.state-chip-job.ready {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.schedule-pill {
  display: inline-block;
  padding: 1px 7px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 6px;
  color: #c7d2fe;
  font-size: 11.5px;
  font-weight: 600;
  margin: 0 2px;
}

.publish-jobs-filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.publish-jobs-filter-tabs .filter-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.publish-jobs-filter-tabs .filter-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.publish-jobs-filter-tabs .filter-tab-btn.active {
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.45);
  color: #34d399;
}

.groups-cache-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  margin-left: 8px;
  vertical-align: middle;
}
.groups-cache-badge.cached {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}
.groups-cache-badge.fresh {
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #34d399;
}

/* Direct Join Log Details */
.direct-join-log-container {
  margin-top: 14px;
  background: #071511;
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
  animation: fadeIn 0.2s ease;
  width: 100%;
}

.direct-join-log-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.direct-join-log-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.direct-join-log-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.direct-join-log-title b {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}

.direct-join-log-title small {
  font-size: 12px;
  color: #94a3b8;
}

.direct-join-log-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  text-align: right;
}

.direct-join-log-table th {
  background: rgba(37, 211, 102, 0.08);
  color: #34d399;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 12px;
  border-bottom: 1px solid rgba(37, 211, 102, 0.25);
  white-space: nowrap;
}

.direct-join-log-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  font-size: 12.5px;
}

.direct-join-log-table tr:hover td {
  background: rgba(37, 211, 102, 0.04);
}

.log-cell-time {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.log-cell-group {
  font-size: 13.5px;
  font-weight: 600;
  color: #f1f5f9;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.log-cell-group b {
  font-size: 13.5px;
  font-weight: 600;
  color: #f1f5f9;
}

.log-cell-link a {
  color: #38bdf8;
  text-decoration: none;
  font-size: 11.5px;
  font-family: var(--font-mono);
  padding: 2px 7px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  transition: all 0.15s ease;
  word-break: break-all;
}

.log-cell-link a:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.log-cell-reason {
  font-size: 12px;
  max-width: 240px;
  line-height: 1.4;
  color: #94a3b8;
}

.warn-text {
  color: #fbbf24;
}

.direct-join-log-empty,
.direct-join-log-loading {
  text-align: center;
  color: var(--muted);
  padding: 16px;
  font-size: 13.5px;
}

.row-joined {
  background: rgba(37, 211, 102, 0.03);
}

.row-skipped {
  background: rgba(245, 158, 11, 0.04);
}

.row-failed {
  background: rgba(239, 68, 68, 0.05);
}

.log-cell-result {
  text-align: center;
  white-space: nowrap;
}

.log-icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.log-status-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-retry-single-row {
  min-height: 24px;
  width: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-retry-single-row:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  transform: scale(1.1);
}

.btn-retry-all-failed {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12.5px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-retry-all-failed:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #fff;
  border-color: #ef4444;
}

.direct-join-log-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}

.log-filter-btn {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.log-filter-btn:hover {
  background: rgba(37, 211, 102, 0.1);
  color: var(--txt);
  border-color: rgba(37, 211, 102, 0.3);
}

.log-filter-btn.active {
  background: rgba(37, 211, 102, 0.18);
  border-color: var(--accent);
  color: #effff8;
  font-weight: 700;
}

.direct-join-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: var(--muted);
}

.pagination-info {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #94a3b8;
  white-space: nowrap;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.5;
}

.pagination-info bdi,
.pagination-info b,
.pagination-info span {
  font-family: inherit;
  font-size: 13px;
}

.pagination-info .pagination-range,
.pagination-info .pagination-total {
  font-weight: 700;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: inline-block;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  min-height: 28px;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: 6px;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--txt);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: #18372e;
  border-color: rgba(37, 211, 102, 0.4);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.pagination-page-indicator {
  font-weight: 700;
  color: #effff8;
  padding: 0 4px;
  font-size: 12.5px;
}

.batch-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 12px
}

.batches-list {
  display: grid;
  gap: 7px;
  align-content: start
}

.batch-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  text-align: right
}

.batch-button span:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px
}

.batch-button small {
  color: var(--muted)
}

.batch-button.active {
  border-color: var(--accent);
  background: #123827
}

.batch-details {
  min-width: 0
}

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

.inspection-counts span {
  background: #081a16;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  color: var(--muted);
  font-size: 12px
}

.inspection-counts b {
  display: block;
  color: var(--txt);
  font-size: 18px
}

.batch-actions {
  margin-bottom: 10px
}

.inspection-results {
  display: grid;
  gap: 8px
}

.inspection-row {
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  border-right: 4px solid var(--line)
}

.inspection-row.status-joinable {
  border-right-color: #25d366
}

.inspection-row.status-approval_required {
  border-right-color: #f2b94b
}

.inspection-row.status-unavailable,
.inspection-row.status-invalid {
  border-right-color: #ff6570
}

.inspection-row.status-duplicate {
  border-right-color: #7c8b86
}

.inspection-row.status-error {
  border-right-color: #a78bfa
}

.inspection-head {
  justify-content: space-between
}

.inspection-head b {
  font-size: 14px
}

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

@media(max-width:700px) {
  .batch-layout {
    grid-template-columns: 1fr
  }

  .inspection-counts {
    grid-template-columns: 1fr 1fr
  }

  .inspect-account-toolbar {
    align-items: flex-start;
    flex-direction: column
  }
}

.prepared-form {
  display: grid;
  gap: 12px
}

.status-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px
}

.status-picker label,
.prepared-account {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, .02)
}

.prepared-accounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px
}

.prepared-account span {
  display: flex;
  flex-direction: column
}

.prepared-account small {
  color: var(--muted)
}

.manual-link-row {
  margin-top: 10px
}

.manual-open {
  display: inline-block;
  text-decoration: none
}

.campaign-form {
  display: grid;
  gap: 10px
}

.template-list {
  display: grid;
  gap: 8px;
  margin-top: 12px
}

.template-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px
}

.template-card b {
  font-size: 15px
}

.template-actions,
.campaign-actions,
.campaign-detail-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap
}

.campaign-actions button {
  flex: 1
}

.campaign-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 12px
}

.campaign-preview-text {
  white-space: pre-wrap;
  text-align: right;
  background: #081a16;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin: 10px 0;
  line-height: 1.8;
  color: var(--txt)
}

.campaign-detail-head h3 {
  margin: 0
}

.campaign-detail-head .muted {
  margin-top: 4px
}

@media(max-width:700px) {
  .campaign-layout {
    grid-template-columns: 1fr
  }

  .template-card {
    align-items: flex-start;
    flex-direction: column
  }

  .template-actions {
    width: 100%
  }

  .template-actions button {
    flex: 1
  }
}

.dashboard-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr))
}

.dashboard-account-list {
  display: grid;
  gap: 8px
}

.dashboard-account-row,
.backup-row,
.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px
}

.dashboard-account-row>div:first-child {
  min-width: 0
}

.dash-account-stats {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end
}

.dash-account-stats span,
.activity-type {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted)
}

.inline-b {
  display: inline !important;
  font-size: inherit !important;
  margin: 0 !important
}

.report-actions,
.backup-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px
}

.report-summary>div {
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px
}

.report-summary b {
  font-size: 22px
}

.backup-list,
.activity-list {
  display: grid;
  gap: 8px;
  margin-top: 12px
}

.activity-row {
  justify-content: flex-start
}

.activity-type {
  flex: 0 0 auto
}

.backup-row>div:first-child {
  min-width: 0
}

@media(max-width:650px) {

  .dashboard-cards,
  .report-summary {
    grid-template-columns: 1fr 1fr
  }

  .dashboard-account-row,
  .backup-row {
    align-items: flex-start;
    flex-direction: column
  }

  .dash-account-stats,
  .backup-actions {
    width: 100%;
    justify-content: flex-start
  }

  .backup-actions button {
    flex: 1
  }
}

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

.diagnostics-grid>div {
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px
}

.diagnostics-grid small,
.diagnostics-grid span {
  color: var(--muted);
  font-size: 12px
}

.diagnostics-grid b {
  font-size: 17px;
  margin: 0
}

@media(max-width:650px) {
  .diagnostics-grid {
    grid-template-columns: 1fr 1fr
  }
}

.export-simple {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px
}

.export-simple label {
  padding: 0
}

.export-simple select {
  margin-top: 6px
}

.export-simple button {
  min-height: 48px
}

@media(max-width:650px) {
  .export-simple {
    grid-template-columns: 1fr
  }

  .export-simple button {
    width: 100%
  }
}

.group-folder-form {
  display: grid;
  gap: 8px
}

.group-folders-list {
  display: grid;
  gap: 10px
}

.group-folder-card {
  background: #0b1c18;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  border-right: 4px solid var(--accent)
}

.group-folder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px
}

.group-folder-card b,
.group-folder-head b {
  font-size: 16px;
  margin: 0
}

.group-folder-card .inspection-counts b {
  font-size: 18px
}

.folder-join-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px auto;
  gap: 9px;
  align-items: end;
  margin: 10px 0
}

.folder-join-controls label {
  padding: 0
}

.folder-join-controls select,
.folder-join-controls input {
  margin-top: 5px
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--txt);
  padding: 11px 13px;
  border-radius: 11px;
  font-weight: 800
}

@media(max-width:700px) {
  .folder-join-controls {
    grid-template-columns: 1fr
  }

  .folder-join-controls button {
    width: 100%
  }

  .group-folder-head {
    align-items: flex-start
  }
}

.member-export-form {
  display: grid;
  gap: 9px
}

.member-export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.member-export-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px
}

.member-export-summary span {
  background: #081a16;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  color: var(--muted)
}

.member-export-summary b {
  display: block;
  color: var(--txt);
  font-size: 20px;
  margin-top: 4px
}

.member-permission {
  margin: 3px 0
}

.member-export-form>.primary {
  min-height: 50px
}

@media(max-width:650px) {
  .member-export-actions button {
    flex: 1
  }

  .member-export-summary {
    grid-template-columns: 1fr 1fr
  }
}

/* Modern Responsive Tab Navigation */
#tabs {
  display: flex;
  gap: 8px;
  overflow: visible; /* Never clip dropdown menus on desktop */
  position: relative;
  z-index: 50; /* Stacking context above main content cards */
  padding: 8px 4px 14px;
  margin-bottom: 18px;
  -webkit-overflow-scrolling: touch;
}

#tabs::-webkit-scrollbar {
  height: 4px;
}

#tabs::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

#tabs button,
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  scroll-snap-align: start;
  flex-shrink: 0;
}

#tabs button:hover,
.tab-btn:hover {
  background: var(--card2);
  color: var(--txt);
  border-color: rgba(37, 211, 102, 0.3);
  transform: translateY(-1px);
}

#tabs button.active,
.tab-btn.active {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.18) 0%, rgba(20, 44, 38, 0.6) 100%);
  color: #effff8;
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(37, 211, 102, 0.2);
  font-weight: 700;
}

.tab-icon {
  font-size: 16px;
  line-height: 1;
}

/* Navigation Drawer (Burger Menu - Modern Web Guidance navigation-drawer) */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  justify-content: flex-start;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: visibility 0.25s ease, opacity 0.25s ease;
}

.nav-drawer.open,
.nav-drawer:popover-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 8, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nav-drawer.open .nav-drawer-backdrop,
.nav-drawer:popover-open .nav-drawer-backdrop {
  opacity: 1;
}

.nav-drawer-sheet {
  position: relative;
  z-index: 2;
  width: min(340px, 86vw);
  height: 100vh;
  background: #0d1e19;
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.nav-drawer.open .nav-drawer-sheet,
.nav-drawer:popover-open .nav-drawer-sheet {
  transform: translateX(0);
}

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 30, 26, 0.95);
  position: sticky;
  top: 0;
  z-index: 3;
}

.nav-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-drawer-title h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--txt);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  min-height: auto;
  border-radius: 8px;
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--txt);
  transform: none;
}

.nav-drawer-current {
  padding: 10px 16px;
  background: rgba(37, 211, 102, 0.08);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-drawer-current b {
  color: var(--accent);
}

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  padding: 10px 8px;
  gap: 4px;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--txt);
  text-align: right;
  width: 100%;
  cursor: pointer;
  transition: all 0.18s ease;
  min-height: 52px;
}

.drawer-nav-item:hover {
  background: var(--card2);
  border-color: rgba(37, 211, 102, 0.2);
  transform: translateX(-3px);
}

.drawer-nav-item.active {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.18) 0%, rgba(20, 44, 38, 0.6) 100%);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(37, 211, 102, 0.18);
}

.drawer-nav-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.drawer-nav-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--txt);
}

.drawer-nav-item.active .drawer-nav-label {
  color: #effff8;
}

.drawer-nav-desc {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.3;
}

/* Drawer More Details Section */
.drawer-more-details {
  margin-top: 6px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

.drawer-more-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(20, 44, 38, 0.4);
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  user-select: none;
  list-style: none;
  transition: all 0.2s ease;
}

.drawer-more-summary::-webkit-details-marker {
  display: none;
}

.drawer-more-summary:hover {
  background: var(--card2);
  color: #effff8;
}

.drawer-more-title {
  flex: 1;
  margin-inline-start: 10px;
}

.more-chevron {
  font-size: 16px;
  transition: transform 0.25s ease;
  line-height: 1;
}

.drawer-more-details[open] .more-chevron {
  transform: rotate(180deg);
}

.drawer-more-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  padding-inline-start: 6px;
  animation: detailsFadeIn 0.25s ease-out;
}

@keyframes detailsFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tabs More Dropdown (Top Navigation - Modern Web Guidance: menu & noise reduction) */
.tabs-more-dropdown {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  z-index: 1000;
}

.more-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.more-caret {
  font-size: 14px;
  transition: transform 0.2s ease;
}

.more-tab-btn[aria-expanded="true"] .more-caret {
  transform: rotate(180deg);
}

.more-tab-btn.has-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.18) 0%, rgba(20, 44, 38, 0.6) 100%);
  color: #effff8;
  box-shadow: 0 0 14px rgba(37, 211, 102, 0.2);
}

.more-tab-btn.has-active::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  margin-inline-start: 4px;
}

.more-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  z-index: 99999; /* Highest z-index: overlays all cards, text, and notices */
  min-width: 220px;
  background: #0d1e19;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(37, 211, 102, 0.2);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: dropdownSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.more-menu-panel[hidden] {
  display: none !important;
}

@keyframes dropdownSlideDown {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.more-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--txt);
  text-align: right;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.more-menu-item:hover {
  background: var(--card2);
  border-color: rgba(37, 211, 102, 0.25);
  transform: translateX(-2px);
}

.more-menu-item.active {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.2) 0%, rgba(20, 44, 38, 0.6) 100%);
  border-color: var(--accent);
  color: #effff8;
  font-weight: 700;
}

/* Nexora publish tables with Sticky Headers (Modern Web Guidance responsive-table) */
.publish-groups-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 8px;
}

.members-filter-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 42, 34, 0.7);
  border: 1px solid rgba(37, 211, 102, 0.22);
  border-radius: 10px;
  padding: 4px 10px;
  flex-wrap: wrap;
}

.members-filter-box .members-filter-label {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  padding: 0;
  margin: 0;
}

.members-filter-box .members-filter-input {
  width: 90px;
  min-width: 75px;
  padding: 5px 8px;
  font-size: 13px;
  border-radius: 7px;
  text-align: center;
  margin: 0;
}

.members-filter-box button {
  padding: 5px 12px;
  font-size: 12.5px;
  min-height: 32px;
}

.members-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0;
  margin: 0;
  user-select: none;
}

.members-filter-toggle input[type="checkbox"] {
  cursor: pointer;
  margin: 0;
}

.publish-groups-stats {
  font-size: 13px;
  padding: 7px 14px;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: 8px;
  margin: 6px 0 12px;
  color: #cbd5e1;
}

.publish-groups-stats b {
  display: inline;
  font-size: inherit;
  font-weight: 700;
  color: #34d399;
  margin: 0 4px;
}

.member-count-badge {
  background: rgba(37, 211, 102, 0.12);
  color: #34d399;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.publish-date-time {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0;
}

.publish-date-time label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.publish-table-card {
  margin-top: 16px;
}

.table-wrapper,
.publish-table-wrap {
  width: 100%;
  max-inline-size: 100%;
  max-block-size: min(520px, 75vh);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.publish-table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
  text-align: right;
}

.publish-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

.publish-table th {
  padding: 13px 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--card2);
  color: var(--txt);
  border-bottom: 2px solid var(--line);
  backdrop-filter: blur(8px);
}

.publish-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  line-height: 1.5;
  color: var(--txt);
}

.publish-table tbody tr:hover td {
  background: rgba(37, 211, 102, 0.04);
}

.publish-table tbody tr:last-child td {
  border-bottom: none;
}

.publish-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 220px;
}

.publish-actions button {
  white-space: nowrap;
}

.publish-delay-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}

.publish-delay-label input {
  width: 70px;
  min-width: 70px;
  padding: 6px 8px;
}

.publish-subline,
.publish-status small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.publish-count-cell {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.publish-count-cell.count-sent {
  color: #34d399;
}

.publish-count-cell.count-pending {
  color: #38bdf8;
}

.publish-count-cell.count-failed {
  color: #f87171;
}

.publish-job-name-cell b {
  font-size: 14.5px;
  font-weight: 700;
  color: #f1f5f9;
  display: block;
}

.publish-history {
  margin: 6px 0;
  background: rgba(14, 42, 34, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
}

.publish-history summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--blue);
  user-select: none;
  outline: none;
  padding: 2px 0;
}

.publish-history summary:hover {
  color: #7dd3fc;
}

.publish-history-item {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(7, 16, 14, 0.6);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.publish-history-item b {
  color: var(--txt);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.publish-history-item span {
  color: var(--muted);
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(92%, 460px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(14, 30, 26, 0.95);
  border: 1px solid var(--line);
  color: var(--txt);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.toast-leave {
  opacity: 0;
  transform: translateY(12px) scale(0.95);
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-success {
  border-color: rgba(37, 211, 102, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(37, 211, 102, 0.15);
}

.toast-error {
  border-color: rgba(248, 113, 113, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(248, 113, 113, 0.15);
}

.toast-warning {
  border-color: rgba(250, 204, 21, 0.4);
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-text {
  flex: 1;
  word-break: break-word;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  border-radius: 6px;
  margin-inline-start: 6px;
  min-height: auto;
}

.toast-close:hover {
  color: var(--txt);
  background: rgba(255, 255, 255, 0.1);
  transform: none;
}

/* Dashboard Cards Enhanced */
.dashboard-cards .card {
  background: linear-gradient(145deg, #0e1e1a 0%, #0a1714 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dashboard-cards .card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 211, 102, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 15px rgba(37, 211, 102, 0.08);
}

.dashboard-cards .card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.dashboard-cards .card b {
  color: var(--txt);
  font-size: 30px;
  font-weight: 800;
  margin-top: 4px;
}

main {
  position: relative;
  z-index: 1;
}

/* Responsive queries */
@media (max-width: 860px) {
  /* On mobile and tablet, horizontal tabs hide and burger icon appears */
  #tabs {
    display: none !important;
  }

  .burger-btn {
    display: inline-flex !important;
  }

  .header-brand {
    gap: 10px;
  }

  .header-brand h1 {
    font-size: 19px;
  }

  .header-brand p {
    font-size: 12.5px;
  }
}

@media (max-width: 700px) {
  .app {
    padding: 10px 8px 70px;
  }
  
  header {
    padding: 12px 14px;
    gap: 8px;
  }

  .header-logo {
    font-size: 24px;
  }

  .header-app-logo {
    width: 38px;
    height: 38px;
  }

  .brand-text-block h1 {
    font-size: 19px;
  }

  .brand-text-block p {
    font-size: 10.5px;
  }

  .header-main-logo {
    height: 38px;
    max-width: 170px;
  }
  
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .dashboard-cards .card b {
    font-size: 24px;
  }
  
  .publish-date-time {
    grid-template-columns: 1fr;
  }

  .publish-table th,
  .publish-table td {
    padding: 9px 8px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .brand-title-wrap p {
    display: none; /* Hide subtitle on tiny screens to keep header compact */
  }

  .burger-btn {
    padding: 6px 10px;
    gap: 8px;
  }

  .burger-label {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  button, .button-link {
    font-size: 13.5px;
  }
}

/* ── Group Leave & Removal Styles ── */
.group-leave-row {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}
.group-leave-row code {
  user-select: all !important;
}
.group-leave-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.group-leave-row.row-selected {
  background: rgba(37, 211, 102, 0.08) !important;
}
.group-leave-table-wrap table tbody tr:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.group-leave-table-wrap table tbody tr td {
  padding: 9px 12px;
  vertical-align: middle;
}
.group-leave-table-wrap table thead th {
  padding: 10px 12px;
  font-weight: 700;
  color: #94a3b8;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}