* { box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; margin: 0; background: #0f1115; color: #e6e6e6; }
.nav { display: flex; gap: 14px; padding: 12px 20px; background: #161a22; border-bottom: 1px solid #232836; align-items: center; }
.nav .brand { font-weight: 700; margin-right: 12px; color: #fff; }
.nav a { color: #9aa4b2; text-decoration: none; }
.nav a.cur { color: #4aa3ff; font-weight: 600; }
.main { padding: 24px; max-width: 1400px; margin: 0 auto; }
h1 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; margin-top: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #232836; font-size: 14px; }
th { color: #8b93a3; font-weight: 600; }
.actions form { display: inline-block; margin-right: 4px; }
button { background: #2a3142; color: #e6e6e6; border: 1px solid #3a4256; padding: 4px 10px; border-radius: 4px; cursor: pointer; }
button:hover { background: #353f55; }
.button-link { display: inline-block; background: #2a2216; color: #fbbf24; border: 1px solid #4a3f16; padding: 4px 10px; border-radius: 4px; text-decoration: none; }
.panel { background: #161a22; border: 1px solid #232836; border-radius: 6px; padding: 12px 16px; margin: 14px 0; }
.panel summary { cursor: pointer; font-weight: 600; }
.panel form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
textarea { background: #0f1115; color: #e6e6e6; border: 1px solid #3a4256; border-radius: 4px; }
input, select { background: #0f1115; color: #e6e6e6; border: 1px solid #3a4256; border-radius: 4px; padding: 4px 6px; }
.filters { margin: 10px 0; }
.filters a { color: #4aa3ff; margin-right: 10px; }
.notice { padding: 8px 12px; border-radius: 6px; margin: 0 0 12px; }
.notice.error { background: #3a1414; color: #f87171; }
.notice.ok { background: #16331f; color: #4ade80; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge.active { background: #16331f; color: #4ade80; }
.badge.alive { background: #16331f; color: #4ade80; }
.badge.imported { background: #2a2a16; color: #eab308; }
.badge.invalid { background: #3a1414; color: #f87171; }
.badge.dead { background: #3a1414; color: #f87171; }
.badge.cooldown { background: #2a2216; color: #fbbf24; }
.badge.paused { background: #2a2230; color: #c084fc; }
.badge.banned { background: #3a1414; color: #f87171; }
.badge.checkpoint { background: #2a2216; color: #fbbf24; }

/* Operator challenge session (accounts/challenge.html) */
.challenge-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
.challenge-bar .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.challenge-screen { position: relative; background: #000; border: 1px solid #232836; border-radius: 6px;
  min-height: 320px; max-width: 1280px; outline: none; }
.challenge-screen:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35); }
.challenge-screen img { display: block; width: 100%; height: auto; cursor: crosshair; user-select: none; }
.challenge-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #8b93a3; font-size: 15px; background: rgba(15, 17, 21, 0.85); }
.challenge-controls { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; max-width: 1280px; }
.challenge-keys { display: flex; flex-wrap: wrap; gap: 8px; }
.challenge-finish { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.challenge-finish .primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.challenge-finish .skip { background: #3a1414; border-color: #5a2424; color: #f87171; }
.badge.rotated, .badge.failed { background: #3a1414; color: #f87171; }
.badge.done, .badge.success { background: #16331f; color: #4ade80; }
.badge.skipped { background: #2a2216; color: #fbbf24; }
.badge.running { background: #16283a; color: #60a5fa; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.card { background: #161a22; border: 1px solid #232836; border-radius: 8px; padding: 16px; }
.card .big { font-size: 28px; font-weight: 700; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 20px; }
.nav .logout { margin-left: auto; }
.nav .logout button { background: #2a2a16; border-color: #4a3f16; color: #eab308; }
.login-wrap { max-width: 320px; margin: 60px auto; background: #161a22; border: 1px solid #232836; border-radius: 8px; padding: 24px; }
.login-wrap h1 { text-align: center; margin: 0 0 18px; }
.login-wrap form { display: flex; flex-direction: column; gap: 12px; }
.login-wrap label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #8b93a3; }
.login-wrap input { padding: 8px; }
.login-wrap button { margin-top: 6px; padding: 10px; }
.login-wrap .err { color: #f87171; background: #3a1414; border: 1px solid #5a2424; border-radius: 4px; padding: 8px; text-align: center; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #8b93a3; }
.hint { font-size: 12px; color: #8b93a3; margin: 6px 0; }
.progress-wrap { background: #161a22; border: 1px solid #232836; border-radius: 4px; overflow: hidden; margin: 10px 0; }
.progress-bar { height: 22px; background: linear-gradient(90deg, #4aa3ff, #2563eb); transform: scaleX(0); transform-origin: left; transition: transform 0.3s; }
.login-wait { margin: 8px 0 4px; }
.login-wait-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.login-wait-eta { font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; color: #e6e6e6; }
.login-wait .hint { margin: 0; }
.login-wait .progress-wrap { background: #0f1115; margin: 8px 0 0; }
.login-wait.alive .login-wait-eta { color: #4ade80; }
.login-wait.late .login-wait-eta { color: #fbbf24; }
.login-wait.dead .login-wait-eta { color: #f87171; }
.login-wait.late .progress-bar { background: linear-gradient(90deg, #fbbf24, #d97706); }
.login-wait.dead .progress-bar { background: linear-gradient(90deg, #f87171, #b91c1c); }
.twofa-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 8px; }
.twofa-form.hidden { display: none; }
.twofa-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #8b93a3; }
.twofa-form input { width: 140px; letter-spacing: 0.2em; font-size: 18px; padding: 8px; }
.code-source-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; }
.code-source-form.hidden { display: none; }
.code-source-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #8b93a3; }
.code-source-form .hint { flex-basis: 100%; }
.code-source-inline { display: inline; }
.code-source-inline select { font-size: 12px; max-width: 220px; }
/* Global manual-code prompt (static/code_requests.js): fixed bottom-right
   stack of cards, hidden until a worker asks for a code. */
.code-popup { display: none; position: fixed; right: 16px; bottom: 16px; z-index: 1000;
  width: 440px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow-y: auto;
  flex-direction: column; gap: 10px; }
.code-popup.open { display: flex; }
.code-popup .code-request { margin: 0; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6); background: #1b1a12; }
.code-request { border-color: #4a3f16; }
.code-request .code-request-eta { font-variant-numeric: tabular-nums; font-weight: 600; color: #fbbf24; }
.code-request .code-request-eta.late { color: #f87171; }
.code-request .skip { background: #3a1414; border-color: #5a2424; color: #f87171; }
.login-actions { margin-top: 10px; }
.login-actions button { background: #3a1414; border-color: #5a2424; color: #f87171; }
.hidden { display: none; }
svg.spark { width: 100%; height: 60px; background: #0f1115; border: 1px solid #232836; border-radius: 4px; }
svg.spark .line { fill: none; stroke: #4aa3ff; stroke-width: 1.5; }

/* Shared Tabulator grid + icon actions (dark theme overrides vendor light CSS) */
.iz-grid-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; margin: 12px 0 0; }
.iz-grid-toolbar + .iz-grid { margin-top: 8px; }
.iz-grid { margin-top: 14px; min-height: 480px; }
.issue-emails-stack { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.issue-emails-stack:empty { display: none; }
.issue-emails-card { margin: 0; }
.issue-emails-meta { font-variant-numeric: tabular-nums; font-weight: 600; margin: 6px 0 0; }
.issue-emails-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.issue-emails-list li { margin: 2px 0; }
.progress-bar.issue-fail { background: linear-gradient(90deg, #f87171, #b91c1c); }
.progress-bar.issue-skip { background: linear-gradient(90deg, #fbbf24, #d97706); }
.progress-bar.issue-done { background: linear-gradient(90deg, #4ade80, #16a34a); }
.iz-grid.iz-grid--compact { min-height: 220px; }
.iz-nested .tabulator,
.iz-nested .iz-grid { min-height: 0; }
body .tabulator {
  background: #12151c;
  border: 1px solid #232836;
  border-radius: 8px;
  font-size: 13px;
  color: #e6e6e6;
}
body .tabulator .tabulator-header,
body .tabulator .tabulator-header .tabulator-header-contents,
body .tabulator .tabulator-header .tabulator-col,
body .tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  background: #161a22;
  color: #8b93a3;
  border-color: #232836;
}
body .tabulator .tabulator-header { border-bottom: 1px solid #232836; }
body .tabulator .tabulator-header .tabulator-col { border-right: 1px solid #232836; }
body .tabulator .tabulator-header .tabulator-col-title { font-weight: 600; color: #8b93a3; }
body .tabulator .tabulator-tableholder,
body .tabulator .tabulator-tableholder .tabulator-table { background: #12151c; color: #e6e6e6; }
body .tabulator-row { background: #12151c; min-height: 40px; color: #e6e6e6; }
body .tabulator-row.tabulator-row-even { background: #161a22; }
body .tabulator-row.tabulator-selectable:hover,
body .tabulator-row:hover { background: #1c2230; }
body .tabulator-row .tabulator-cell { border-right: 1px solid #232836; border-bottom: 1px solid #232836; padding: 8px 10px; color: #e6e6e6; }
body .tabulator-footer,
body .tabulator .tabulator-footer .tabulator-paginator,
body .tabulator .tabulator-footer .tabulator-page {
  background: #161a22;
  color: #8b93a3;
  border-color: #232836;
}
body .tabulator .tabulator-footer { border-top: 1px solid #232836; }
body .tabulator .tabulator-footer .tabulator-page { background: #2a3142; color: #e6e6e6; }
body .tabulator .tabulator-footer .tabulator-page.active { background: #2563eb; color: #fff; }
body .tabulator-placeholder,
body .tabulator-placeholder span { background: transparent; color: #8b93a3; }
body .tabulator .tabulator-alert { background: rgba(15, 17, 21, 0.85); color: #e6e6e6; }
body .tabulator-row.iz-row-open { background: #182032; }
.iz-nested { padding: 8px 8px 12px 44px; background: #0c0f14; border-top: 1px solid #232836; }
.iz-nested .tabulator { margin-top: 8px; }
.iz-nested-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 8px; }
.iz-nested-toolbar form { display: flex; gap: 6px; align-items: center; margin: 0; }
.iz-nested-toolbar label { font-size: 12px; color: #8b93a3; display: flex; gap: 6px; align-items: center; }
.icon-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.icon-form { display: inline; margin: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border-radius: 6px; background: #2a3142; color: #e6e6e6; border: 1px solid #3a4256; cursor: pointer; text-decoration: none; }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: #353f55; }
.icon-btn--danger { background: #3a1414; border-color: #5a2424; color: #f87171; }
.icon-btn--danger:hover { background: #4a1a1a; }
.icon-btn--warn, .icon-btn--lit { background: #2a2216; border-color: #4a3f16; color: #fbbf24; }
.icon-btn--warn:hover, .icon-btn--lit:hover { background: #3a2e18; }
.icon-btn--ok { background: #16331f; border-color: #245c34; color: #4ade80; }
.icon-btn--ok:hover { background: #1c4028; }
.icon-btn--expand svg { transition: transform 0.15s; }
.iz-row-open .icon-btn--expand svg { transform: rotate(90deg); }
.badge.free { background: #16331f; color: #4ade80; }
.badge.reserved { background: #2a2a16; color: #eab308; }
.badge.used { background: #16283a; color: #60a5fa; }
.badge.burned { background: #3a1414; color: #f87171; }
.badge.icloud { background: #2a2230; color: #c084fc; }
.badge.instagram { background: #16283a; color: #60a5fa; }
.badge.check { background: #2a2a16; color: #eab308; }
.badge.register, .badge.upload { background: #16283a; color: #60a5fa; }
.logs-context { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: #9aa4b2; word-break: break-all; }
