* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f7fa; color: #1a1a2e; padding: 20px; }
.container { max-width: 1060px; margin: 0 auto; }
h1 { font-size: 24px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.subtitle { color: #666; font-size: 14px; margin-bottom: 24px; }

.card { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.card h2 { font-size: 16px; margin-bottom: 16px; color: #333; border-bottom: 1px solid #eee; padding-bottom: 8px; }

.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.form-group { flex: 1; min-width: 180px; }
.form-group label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; font-weight: 600; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.form-group textarea { resize: vertical; min-height: 60px; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: #4a6cf7; outline: none; }
.form-hint { font-size: 11px; color: #999; margin-top: 2px; }

.file-row { display: flex; gap: 16px; margin-bottom: 12px; }
.file-group { flex: 1; }
.file-group label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; font-weight: 600; }
.file-group input[type="file"] { width: 100%; padding: 6px 0; font-size: 14px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 32px; font-size: 16px; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-primary { color: #fff; background: #4a6cf7; }
.btn-primary:hover:not(:disabled) { background: #3b5de7; }
.btn-primary:disabled { background: #b0b8c8; cursor: not-allowed; }
.btn-secondary { color: #fff; background: #6b7280; }
.btn-secondary:hover:not(:disabled) { background: #4b5563; }
.btn-secondary:disabled { background: #b0b8c8; cursor: not-allowed; }
.btn-success { color: #fff; background: #22c55e; }
.btn-success:hover:not(:disabled) { background: #16a34a; }
.btn-success:disabled { background: #b0b8c8; cursor: not-allowed; }
.btn-danger { color: #fff; background: #ef4444; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-danger:disabled { background: #fca5a5; cursor: not-allowed; }
.btn-warning { color: #fff; background: #f59e0b; }
.btn-warning:hover:not(:disabled) { background: #d97706; }
.btn-warning:disabled { background: #b0b8c8; cursor: not-allowed; }
.btn-download { color: #fff; text-decoration: none; }
.btn-download-cemetery { background: #f59e0b; }
.btn-download-cemetery:hover { background: #d97706; }
.btn-download-result { background: #22c55e; }
.btn-download-result:hover { background: #16a34a; }
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.log-container { background: #1a1a2e; color: #e0e0e0; border-radius: 8px; padding: 16px; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; line-height: 1.6; max-height: 400px; overflow-y: auto; min-height: 100px; }
.log-container .log-entry { padding: 2px 0; white-space: pre-wrap; word-break: break-all; }
.log-container .log-cemetery { color: #fbbf24; }
.log-container .log-clone { color: #34d399; }
.log-container .log-error { color: #ef4444; font-weight: bold; }
.log-container .log-done { color: #4ade80; font-weight: bold; }
.log-container .log-info { color: #60a5fa; }
.log-empty { color: #666; font-style: italic; }

.status-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; transition: .2s; }
.status-idle { background: #e5e7eb; color: #666; }
.status-running { background: #dbeafe; color: #2563eb; }
.status-done { background: #dcfce7; color: #16a34a; }
.status-error { background: #fce7e7; color: #dc2626; }

.steps { display: flex; gap: 0; margin-bottom: 20px; background: #e5e7eb; border-radius: 8px; overflow: hidden; }
.step { flex: 1; padding: 10px; text-align: center; font-size: 13px; font-weight: 600; color: #9ca3af; transition: .2s; }
.step.active { background: #4a6cf7; color: #fff; }
.step.done { background: #22c55e; color: #fff; }
.step-num { display: inline-block; width: 22px; height: 22px; line-height: 22px; border-radius: 50%; text-align: center; margin-right: 6px; font-size: 12px; background: rgba(255,255,255,.3); }

.download-area { display: none; margin-top: 12px; }
.download-area.show { display: flex; gap: 12px; flex-wrap: wrap; }

.summary-box { background: #f0f4ff; border: 1px solid #dbeafe; border-radius: 8px; padding: 12px; margin-bottom: 12px; font-size: 13px; }
.summary-box .stat { display: inline-block; margin-right: 20px; }
.summary-box .stat-val { font-weight: 700; font-size: 16px; color: #2563eb; }
.summary-box .stat-label { color: #666; font-size: 11px; }

.tabs { display: flex; gap: 0; margin-bottom: 20px; background: #e5e7eb; border-radius: 8px; overflow: hidden; }
.tab { flex: 1; padding: 12px; text-align: center; font-size: 14px; font-weight: 600; color: #9ca3af; cursor: pointer; transition: .2s; border: none; background: none; }
.tab.active { background: #4a6cf7; color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.config-card { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.config-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.config-title { font-weight: 600; font-size: 15px; }
.config-meta { font-size: 12px; color: #666; margin-top: 2px; }
.config-actions { display: flex; gap: 6px; flex-shrink: 0; }
.config-results { margin-top: 8px; border-top: 1px solid #e5e7eb; padding-top: 8px; }
.result-time { font-size: 11px; color: #999; margin-bottom: 6px; }
.result-list { list-style: none; padding: 0; margin: 0; }
.result-item { padding: 4px 8px; font-size: 13px; font-family: 'SF Mono', 'Fira Code', monospace; border-radius: 4px; margin-bottom: 2px; background: #f3f4f6; }
.result-item a { color: #2563eb; text-decoration: none; margin-left: 6px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.result-item a:hover { text-decoration: underline; }
.result-item.highlight { background: #fef3c7; color: #92400e; font-weight: 700; border-left: 3px solid #f59e0b; }
.result-item.highlight a { color: #92400e; }

.settings-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.settings-row label { font-size: 14px; font-weight: 600; color: #333; }
.settings-row input { width: 100px; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; text-align: center; }
.settings-row input:focus { border-color: #4a6cf7; outline: none; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 520px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.modal .form-group { margin-bottom: 12px; }

.engine-status { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.engine-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.engine-dot.on { background: #22c55e; }
.engine-dot.off { background: #ef4444; }

.config-empty { color: #666; font-style: italic; padding: 20px 0; text-align: center; }

/* ---- Auth Screen ---- */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: #f5f7fa;
  z-index: 1000;
}
.auth-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 400px;
  max-width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
}
.auth-box h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: #333;
}
.auth-box .form-group {
  margin-bottom: 16px;
}
.auth-error {
  background: #fef2f2;
  color: #dc2626;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.auth-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #666;
}
.auth-switch a {
  color: #4a6cf7;
  text-decoration: none;
  font-weight: 600;
}
.auth-switch a:hover {
  text-decoration: underline;
}

/* ---- App Header ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-header h1 {
  margin-bottom: 0;
}
.header-username {
  font-size: 13px;
  color: #666;
  background: #e5e7eb;
  padding: 3px 10px;
  border-radius: 12px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Account Cards ---- */
.account-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.account-card-info {
  flex: 1;
  min-width: 0;
}
.account-card-name {
  font-weight: 600;
  font-size: 15px;
}
.account-card-meta {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.account-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.account-balances {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.balance-item {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
}
.balance-wallet {
  background: #dbeafe;
  color: #2563eb;
}
.balance-advance {
  background: #dcfce7;
  color: #16a34a;
}
.balance-advance-low {
  background: #fce7e7;
  color: #dc2626;
}
.balance-loading {
  font-size: 11px;
  color: #999;
  font-style: italic;
}
.balance-error {
  font-size: 11px;
  color: #ef4444;
}

.account-card .acc-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  background: #dcfce7;
  color: #16a34a;
  white-space: nowrap;
}

#accountsContainer .account-card.overview-account-selectable {
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

#accountsContainer .account-card.overview-account-selectable:hover {
  border-color: #93b4ee;
  background: #f7faff;
}

#accountsContainer .account-card.overview-account-selectable:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 2px;
}

#accountsContainer .account-card.overview-account-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

#accountsContainer .account-card.overview-account-selected .acc-badge {
  background: #2563eb;
  color: #fff;
}

/* ---- Bidding ---- */
.bid-card { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.bid-header { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.bid-checkbox { flex-shrink: 0; }
.bid-checkbox input { width: 18px; height: 18px; cursor: pointer; }
.bid-info { flex: 1; cursor: pointer; min-width: 0; }
.bid-promotions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; font-size: 11px; color: #555; }
.bid-promotions label { display: flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.bid-promotions input { width: 15px; height: 15px; cursor: pointer; }
.bid-title { font-weight: 600; font-size: 14px; }
.bid-meta { font-size: 12px; color: #666; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bid-position { flex-shrink: 0; font-size: 14px; min-width: 50px; text-align: right; }
.bid-body { margin-top: 12px; border-top: 1px solid #e5e7eb; padding-top: 12px; }
.bid-config .form-row { margin-bottom: 8px; }
.bid-config .form-group label { font-size: 11px; }
.bid-config .form-group input,
.bid-config .form-group select { padding: 6px 8px; font-size: 13px; }
.bid-bar-wrap { margin-top: 8px; }
.bid-bar-label { font-size: 12px; color: #555; margin-bottom: 4px; }
.bid-bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.bid-bar-fill { height: 100%; background: #4a6cf7; border-radius: 4px; transition: width .3s; }
.bid-history { font-size: 12px; }
.history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.history-table th { background: #f3f4f6; padding: 6px 8px; text-align: left; font-weight: 600; border-bottom: 2px solid #e5e7eb; }
.history-table td { padding: 4px 8px; border-bottom: 1px solid #f3f4f6; }
.history-table tr:hover td { background: #f9fafb; }
.bid-up { color: #ef4444; font-weight: 600; }
.bid-down { color: #22c55e; font-weight: 600; }
.bid-results { font-size: 12px; }
.bid-settings-panel { margin-top: 12px; border: 1px solid #dbe3f0; border-radius: 10px; overflow: hidden; background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.bid-settings-panel:has(.bid-settings-toggle[aria-expanded="true"]) { border-color: #bfd0e4; box-shadow: 0 5px 16px rgba(16, 36, 62, .06); }
.bid-settings-toggle { width: 100%; min-height: 48px; border: 0; background: #f3f6fb; color: #334155; padding: 9px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; font: inherit; text-align: left; transition: background .2s ease, color .2s ease; }
.bid-settings-toggle:hover { background: #edf3fa; color: #1e3a5f; }
.bid-settings-toggle:focus-visible { outline: 2px solid #2f80ed; outline-offset: -2px; }
.bid-settings-heading { display: flex; align-items: center; gap: 9px; min-width: 0; }
.bid-settings-heading > span:last-child { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.bid-settings-heading strong { color: #334155; font-size: 13px; font-weight: 650; line-height: 1.3; }
.bid-settings-heading small { color: #64748b; font-size: 10px; font-weight: 400; line-height: 1.35; }
.bid-settings-icon { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 7px; background: #e8f0fb; font-size: 14px; }
.bid-settings-icon-warning { background: #fff3d6; }
.bid-settings-toggle[aria-expanded="true"] .bid-schedule-chevron { transform: rotate(180deg); }
.bid-schedule-chevron { flex: 0 0 auto; color: #64748b; font-size: 18px; line-height: 1; transition: transform .2s ease; }
.bid-settings-body { padding: 15px; border-top: 1px solid #e7edf4; background: #fff; }
.bid-schedule-label { margin: 0 0 7px; color: #475569; font-size: 12px; font-weight: 600; }
.bid-schedule-days { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 14px; }
.bid-schedule-days label,
.bid-schedule-hours label { display: flex; align-items: center; gap: 5px; color: #475569; font-size: 12px; cursor: pointer; }
.bid-schedule-days input,
.bid-schedule-hours input { width: 15px; height: 15px; }
.bid-schedule-hours { display: grid; grid-template-columns: repeat(6, minmax(70px, 1fr)); gap: 9px 14px; margin-bottom: 14px; }
.bid-off-hours-row { display: flex; align-items: flex-end; gap: 12px; border-top: 1px solid #e5e7eb; padding-top: 12px; }
.bid-off-hours-row .form-group { flex: 1; margin: 0; }
.bid-off-hours-fixed { max-width: 220px; }
.bid-max-actions-intro { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; }
.bid-max-actions-intro strong, .bid-max-promotions-heading strong { color: #334155; font-size: 12px; font-weight: 650; }
.bid-max-actions-intro span, .bid-max-promotions-heading span { color: #64748b; font-size: 11px; line-height: 1.45; }
.bid-max-action-select { margin: 0; }
.bid-max-action-select > label, .bid-max-fixed > label { display: block; margin-bottom: 6px; color: #475569; font-size: 11px !important; font-weight: 600; }
.bid-max-action-select select { min-height: 40px; padding: 8px 34px 8px 10px !important; font-size: 12px !important; }
.bid-max-fixed { max-width: 310px; margin: 14px 0 0; padding: 12px; border: 1px solid #dbeafe; border-radius: 8px; background: #f7fbff; }
.bid-max-fixed > small { display: block; margin-top: 7px; color: #64748b; font-size: 10px; line-height: 1.4; }
.bid-input-with-suffix { position: relative; }
.bid-input-with-suffix input { padding-right: 34px !important; background: #fff; }
.bid-input-with-suffix > span { position: absolute; top: 50%; right: 12px; color: #64748b; font-size: 12px; transform: translateY(-50%); pointer-events: none; }
.bid-max-promotions { flex-direction: column; gap: 10px; margin-top: 14px; padding: 12px; border: 1px solid #dbeafe; border-radius: 8px; background: #f7fbff; }
.bid-max-promotions-heading { display: flex; flex-direction: column; gap: 2px; }
.bid-max-promotion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.bid-option-card { position: relative; display: flex; align-items: flex-start; gap: 9px; min-height: 58px; padding: 10px; border: 1px solid #dbe3f0; border-radius: 8px; background: #fff; cursor: pointer; transition: border-color .2s ease, background .2s ease, box-shadow .2s ease; }
.bid-option-card:hover { border-color: #9fc1eb; background: #fbfdff; }
.bid-option-card:has(input:focus-visible) { outline: 2px solid #2f80ed; outline-offset: 2px; }
.bid-option-card:has(input:checked) { border-color: #2f80ed; background: #eef6ff; box-shadow: 0 0 0 1px rgba(47, 128, 237, .08); }
.bid-option-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bid-option-check { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; border: 1.5px solid #b8c6d5; border-radius: 5px; color: transparent; background: #fff; font-size: 11px; font-weight: 700; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.bid-option-card:has(input:checked) .bid-option-check { border-color: #2f80ed; background: #2f80ed; color: #fff; }
.bid-auto-save-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 20px; margin-top: 14px; padding-top: 11px; border-top: 1px solid #e8edf5; }
.bid-auto-save-hint { color: #94a3b8; font-size: 10px; line-height: 1.4; }
.bid-auto-save-status { display: inline-flex; align-items: center; gap: 5px; color: #64748b; font-size: 10px; font-weight: 650; line-height: 1.4; white-space: nowrap; }
.bid-auto-save-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.bid-auto-save-status:empty::before { display: none; }
.bid-auto-save-status.saving { color: #64748b; }
.bid-auto-save-status.saved { color: #16845b; }
.bid-auto-save-status.error { color: #c2413b; white-space: normal; text-align: right; }
.bid-option-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bid-option-copy strong { color: #334155; font-size: 11px; font-weight: 650; line-height: 1.35; }
.bid-option-copy small { color: #64748b; font-size: 10px; line-height: 1.35; }
.bid-max-promotions-note { padding-top: 9px; border-top: 1px solid #dbeafe; color: #526a84; font-size: 10px; line-height: 1.4; }
@media (max-width: 760px) {
  .bid-schedule-hours { grid-template-columns: repeat(3, minmax(70px, 1fr)); }
  .bid-off-hours-row { align-items: stretch; flex-direction: column; }
  .bid-off-hours-fixed { max-width: none; }
  .bid-max-fixed { max-width: none; }
  .bid-max-promotion-grid { grid-template-columns: 1fr; }
  .bid-settings-heading strong { font-size: 12px; }
  .bid-settings-heading small { white-space: normal; }
}
.highlight-row { background: #fef3c7; font-weight: 600; }
.highlight-row td { border-bottom-color: #f59e0b; }

/* ---- Прямая ссылка (Plain URL) ---- */
.bid-config .form-group input.field-disabled,
.bid-config .form-group input.field-disabled:focus {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  border-color: #e5e7eb;
  opacity: 0.6;
}
.bid-plain-url-row .form-group {
  min-width: 100%;
}
.bid-plain-url-row .form-group input {
  width: 100%;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
}

/* ---- Recreate ---- */
.recreate-candidate { background: #fff8f0; border: 1px solid #fed7aa; border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.recreate-candidate .rc-info { flex: 1; min-width: 0; }
.recreate-candidate .rc-title { font-size: 13px; font-weight: 600; }
.recreate-candidate .rc-meta { font-size: 11px; color: #888; }
.recreate-candidate .rc-position { font-size: 12px; font-weight: 600; white-space: nowrap; }
.recreate-candidate .rc-city { flex: 0 0 200px; }
.recreate-candidate .rc-city input,
.recreate-candidate .rc-city select { width: 100%; padding: 5px 8px; border: 1px solid #ddd; border-radius: 5px; font-size: 13px; }
.recreate-candidate .rc-city input:focus,
.recreate-candidate .rc-city select:focus { border-color: #f59e0b; outline: none; }
.recreate-candidate .rc-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #fef3c7; color: #92400e; white-space: nowrap; }
.recreate-candidate.done .rc-badge { background: #dcfce7; color: #16a34a; }

/* ---- Autoload (Автозагрузка) ---- */
.autoload-file-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 100px;
  text-align: center;
}
.autoload-file-card:hover {
  border-color: #4a6cf7;
  background: #eff3ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(74,108,247,0.15);
}
.autoload-file-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 2px;
}
.autoload-file-name {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  word-break: break-all;
  max-width: 120px;
  line-height: 1.3;
}
.autoload-file-size {
  font-size: 11px;
  color: #999;
}

/* ---- Toast-уведомления ---- */
.bid-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 320px;
  max-width: 480px;
  padding: 16px 20px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  z-index: 9999;
  animation: bidToastSlideIn 0.3s ease-out;
  font-size: 14px;
  line-height: 1.5;
}
.bid-toast-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}
.bid-toast-info {
  background: #dbeafe;
  border: 1px solid #4a6cf7;
  color: #1e40af;
}
.bid-toast-error {
  background: #fce7e7;
  border: 1px solid #ef4444;
  color: #dc2626;
}
.bid-toast-success {
  background: #dcfce7;
  border: 1px solid #22c55e;
  color: #16a34a;
}
.bid-toast-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  line-height: 1;
}
.bid-toast-close:hover {
  opacity: 1;
}
.bid-toast-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  padding-right: 20px;
}
.bid-toast-message {
  font-size: 13px;
  opacity: 0.9;
}

@keyframes bidToastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ================================================================
   AD CREATOR — Степпер создания объявлений
   ================================================================ */

.ad-creator-stepper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-card {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: all 0.3s ease;
}

.step-card.disabled {
  opacity: 0.55;
  background: #fafafa;
}

.step-card.disabled .step-body {
  display: none;
}

.step-card:not(.disabled) {
  border-color: #4a6cf7;
  box-shadow: 0 2px 12px rgba(74,108,247,0.1);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #f8f9ff;
  cursor: default;
}

.step-card.disabled .step-header {
  background: #f5f5f5;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #4a6cf7;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.step-card.disabled .step-number {
  background: #bbb;
}

.step-title {
  font-weight: 600;
  font-size: 15px;
  color: #333;
  flex: 1;
}

.step-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  background: #fff3cd;
  color: #856404;
  font-weight: 500;
  white-space: nowrap;
}

.step-card:not(.disabled) .step-badge {
  background: #d1ecf1;
  color: #0c5460;
}

.step-body {
  padding: 16px 18px;
  border-top: 1px solid #e8e8e8;
}

.step-status {
  font-size: 13px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
}

/* Category tree */
.category-tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 13px;
  cursor: default;
}

.category-tree-item:hover {
  background: #f0f4ff;
  border-radius: 4px;
}

.category-tree-item.selected {
  background: #e3f2fd;
  border-radius: 4px;
  font-weight: 600;
}

.category-tree-item .cat-name {
  cursor: pointer;
}

.expand-cat-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
  padding: 2px 4px;
  color: #666;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.expand-cat-btn:hover {
  color: #4a6cf7;
}

.expand-placeholder {
  display: inline-block;
  width: 20px;
  flex-shrink: 0;
}

/* Category search results */
.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.category-item:hover {
  background: #f0f4ff;
}

.category-item .cat-path {
  color: #666;
  font-size: 12px;
}

.btn-xs {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
}

.info-row {
  font-size: 13px;
  padding: 3px 0;
  color: #444;
}

/* ================================================================
   CERBER PRODUCT SHELL — task-oriented dashboard redesign
   ================================================================ */
:root {
  --navy-950: #041a32;
  --navy-900: #082540;
  --navy-800: #123b5f;
  --ink-950: #10243e;
  --ink-700: #40556f;
  --ink-500: #71839a;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --line: #dce5ed;
  --line-soft: #eaf0f5;
  --green: #079455;
  --green-dark: #067647;
  --green-soft: #e8f7ef;
  --blue: #2f80ed;
  --blue-soft: #eaf2ff;
  --amber: #e87511;
  --amber-soft: #fff2e3;
  --red: #d92d20;
  --red-soft: #ffebe9;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 36, 62, .04), 0 8px 24px rgba(16, 36, 62, .035);
}

html { min-height: 100%; background: var(--canvas); }
body {
  min-height: 100%;
  padding: 0;
  background: var(--canvas);
  color: var(--ink-950);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(47, 128, 237, .26);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; width: 100%; }
.app-main {
  min-height: 100vh;
  margin-left: 232px;
  padding: 26px 30px 42px;
  overflow-x: hidden;
}
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 900;
  width: 232px;
  display: flex;
  flex-direction: column;
  padding: 22px 12px;
  background: linear-gradient(180deg, var(--navy-950), #062b4c 100%);
  color: #fff;
  box-shadow: 10px 0 30px rgba(4, 26, 50, .08);
}
.sidebar-brand, .auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand { padding: 0 10px 24px; font-size: 22px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 54px;
  border: 2px solid currentColor;
  border-radius: 18px 18px 24px 24px;
  color: var(--green);
  font-weight: 800;
  letter-spacing: -.08em;
  transform: scale(.86);
}
.brand-mark-sidebar { color: #fff; width: 46px; height: 50px; }
.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 5px; }
.sidebar-link {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #d8e4ef;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.sidebar-link.active { background: rgba(92, 160, 214, .17); color: #fff; }
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #34d399;
}
.nav-icon { width: 21px; font-size: 19px; line-height: 1; text-align: center; }
.sidebar-divider { height: 1px; margin: 13px 6px; background: rgba(255,255,255,.12); }
.sidebar-user {
  display: grid;
  grid-template-columns: 38px 1fr 28px;
  align-items: center;
  gap: 10px;
  padding: 14px 8px 0;
  border-top: 1px solid rgba(255,255,255,.12);
}
.sidebar-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #eef3f7;
  color: var(--navy-900);
  font-weight: 700;
}
.sidebar-user div { min-width: 0; }
.sidebar-user strong, .sidebar-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user div span { margin-top: 2px; color: #aebfd0; font-size: 12px; }
.sidebar-logout { border: 0; background: transparent; color: #aebfd0; font-size: 20px; cursor: pointer; }
.sidebar-logout:hover { color: #fff; }
.sidebar-scrim { display: none; }

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 22px;
  max-width: 1500px;
}
.header-left { align-items: flex-start; gap: 12px; }
.breadcrumbs { margin-bottom: 10px; color: var(--ink-500); font-size: 12px; }
.breadcrumbs span { margin: 0 6px; color: #b0bcc8; }
.breadcrumbs strong { color: var(--ink-700); font-weight: 500; }
.app-header h1 { margin: 0; color: var(--ink-950); font-size: clamp(24px, 2.1vw, 34px); letter-spacing: -.035em; }
.page-subtitle { margin-top: 2px; color: var(--ink-500); font-size: 14px; }
.header-right { gap: 10px; padding-top: 23px; flex-wrap: nowrap; }
.account-filter, .icon-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-950);
  box-shadow: 0 1px 2px rgba(16,36,62,.03);
  cursor: pointer;
}
.account-filter { min-width: 200px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.icon-button { position: relative; width: 44px; padding: 0; color: var(--navy-900); }
.icon-button i { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.mobile-nav-toggle { display: none; border: 0; background: transparent; font-size: 24px; color: var(--ink-950); }

.btn {
  min-height: 42px;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 9px;
  font-size: 14px;
  box-shadow: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(16,36,62,.1); }
.btn-sm { min-height: 36px; padding: 7px 13px; font-size: 12px; }
.btn-primary, .btn-success { background: var(--green); color: #fff; }
.btn-primary:hover:not(:disabled), .btn-success:hover:not(:disabled) { background: var(--green-dark); }
.btn-secondary { border: 1px solid var(--line); background: #fff; color: var(--ink-950); }
.btn-secondary:hover:not(:disabled) { background: #f8fafc; }
.btn-danger { background: var(--red); }
.tabs { display: none; }
.tab-panel { max-width: 1500px; margin: 0 auto; }
.tab-panel.active { display: block; animation: panelEnter .22s ease-out; }
@keyframes panelEnter { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

.overview-engine-banner {
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) minmax(300px, .9fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 92px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.overview-engine-banner.running { border-color: #cdebdc; }
.overview-engine-copy { display: flex; align-items: center; gap: 15px; }
.overview-engine-icon {
  display: grid;
  place-items: center;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 26px;
  font-weight: 700;
}
.overview-engine-banner.running .overview-engine-icon { background: var(--green); color: #fff; }
.overview-engine-copy h2 { margin: 0 0 4px; border: 0; padding: 0; color: var(--ink-950); font-size: 15px; }
.overview-engine-copy p, .section-heading p { margin: 0; color: var(--ink-500); font-size: 12px; }
.overview-engine-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.overview-engine-stats div { min-width: 72px; }
.overview-engine-stats span, .overview-engine-stats strong { display: block; }
.overview-engine-stats span { margin-bottom: 4px; color: var(--ink-700); font-size: 10px; white-space: nowrap; }
.overview-engine-stats strong { font-size: 18px; }
.positive { color: var(--green) !important; }
.warning { color: var(--amber) !important; }
.danger { color: var(--red) !important; }

.overview-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.metric-card, .overview-card, .card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.metric-card { min-height: 132px; padding: 16px; }
.overview-tabs { display: flex; margin-bottom: 18px; }
.bidding-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.bidding-list-heading > h2 { margin: 0; padding: 0; border: 0; }
.bidding-list-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.bidding-account-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bidding-account-control > label {
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.bidding-account-control select {
  min-width: 180px;
  min-height: 36px;
  padding: 7px 30px 7px 10px;
  font-size: 12px;
}
.dashboard-section-heading { overflow: visible; }
.dashboard-sort-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.dashboard-sort-toolbar > label {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.dashboard-sort-toolbar select {
  min-width: 220px;
  min-height: 36px;
  padding: 7px 32px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: #fff;
  color: var(--ink-700);
  font-size: 11px;
  cursor: pointer;
}
.bidding-sort-toolbar select { min-width: 205px; }
.dashboard-sort-toolbar select:hover:not(:disabled),
.dashboard-sort-toolbar select:focus { border-color: #b8c9d9; }
.dashboard-sort-direction {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--blue);
  font-size: 17px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.dashboard-sort-direction:hover:not(:disabled) { border-color: #b8c9d9; background: #f6f9fc; }
.dashboard-sort-toolbar select:disabled,
.dashboard-sort-direction:disabled { cursor: default; opacity: .52; }
.dashboard-ad-cards { display: grid; gap: 14px; }
.dashboard-ad-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line, #dde4eb);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 36, 62, .045);
}
.dashboard-ad-summary {
  display: grid;
  grid-template-columns: minmax(300px, 1.65fr) 118px 78px minmax(510px, 2.65fr);
  align-items: center;
  gap: 18px;
  min-height: 154px;
  padding: 20px 56px 20px 24px;
}
.dashboard-ad-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}
.dashboard-ad-thumb {
  position: relative;
  width: 94px;
  height: 110px;
  overflow: hidden;
  border-radius: 17px;
  background: linear-gradient(145deg, #f1f4f7, #e3e9ef);
}
.dashboard-ad-thumb > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #9aabba;
}
.dashboard-ad-thumb > span svg { width: 32px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.dashboard-ad-thumb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.dashboard-ad-thumb.broken img { display: none; }
.dashboard-ad-copy { min-width: 0; }
.dashboard-ad-title-row { min-width: 0; display: flex; align-items: center; gap: 11px; }
.dashboard-ad-state-dot {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #b9c4cf;
  box-shadow: 0 0 0 4px #f4f6f8;
}
.dashboard-ad-state-dot.active { background: #16b364; box-shadow: 0 0 0 4px #e7f8ef; }
.dashboard-ad-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--blue, #2563eb);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
}
.dashboard-ad-title > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-ad-title:hover { color: #1468cf; }
.dashboard-ad-statuses {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 650;
}
.dashboard-ad-statuses > i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8fa0b2;
}
.dashboard-ad-statuses .good { color: var(--green); }
.dashboard-ad-statuses .warning { color: var(--amber); }
.dashboard-ad-checked { margin-top: 8px; color: var(--ink-500); font-size: 12px; }
.dashboard-ad-bid {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
}
.dashboard-ad-position {
  min-width: 118px;
  min-height: 92px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  gap: 4px;
  padding: 11px 12px 10px;
  border: 0;
  border-radius: 11px;
  background: var(--position-bg);
}
.dashboard-ad-position-target {
  color: var(--position-label);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.1;
}
.dashboard-ad-position-value {
  align-self: center;
  color: var(--position-value);
  font-size: 28px;
  font-weight: 750;
  line-height: 1;
}
.dashboard-ad-position-footer {
  color: var(--position-status);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
}
.dashboard-ad-position.is-target {
  --position-bg: #edf9f2;
  --position-label: #4a9c56;
  --position-value: #419345;
  --position-status: #56a86f;
}
.dashboard-ad-position.is-outside {
  --position-bg: #fcf7ec;
  --position-label: #f1ab3f;
  --position-value: #e49b39;
  --position-status: #f0ac49;
}
.dashboard-ad-position.is-unknown {
  --position-bg: #f6f6f6;
  --position-label: #576076;
  --position-value: #233149;
  --position-status: #848b9f;
}
.dashboard-ad-bid > span {
  color: var(--ink-500);
  font-size: 10px;
  white-space: nowrap;
}
.dashboard-ad-bid strong {
  padding: 7px 10px;
  border: 1px solid #d8e2ea;
  border-radius: 9px;
  background: #f6f9fb;
  color: var(--ink-950);
  font-size: 13px;
  white-space: nowrap;
}
.dashboard-ad-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(86px, 1fr));
  align-items: stretch;
  gap: 0;
  margin: 0;
}
.dashboard-ad-metrics > div {
  min-width: 0;
  display: grid;
  align-content: center;
  min-height: 84px;
  padding: 8px 18px;
  border-left: 1px solid var(--line-soft);
}
.dashboard-ad-card dt { color: var(--ink-500, #64748b); font-size: 10px; line-height: 1.35; }
.dashboard-ad-card dd { margin: 9px 0 0; color: var(--ink-950, #0f172a); font-size: 14px; font-weight: 750; }
.dashboard-ad-average {
  margin-left: 10px;
  border: 0 !important;
  border-radius: 10px;
  background: linear-gradient(135deg, #e9fbf2, #def8ec);
}
.dashboard-ad-expand {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-700);
  cursor: pointer;
  transition: background .18s ease, transform .2s ease;
}
.dashboard-ad-expand:hover { background: #f1f5f8; }
.dashboard-ad-expand svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform .2s ease;
}
.dashboard-ad-card.expanded .dashboard-ad-expand svg { transform: rotate(180deg); }
.dashboard-ad-detail {
  margin: 0 24px;
  border-top: 1px solid var(--line-soft, #eef2f6);
  padding: 4px 0 20px;
}
.dashboard-history { min-width: 0; }
.dashboard-history h4 { margin: 0 0 9px; color: var(--ink-700, #334155); font-size: 12px; }
.dashboard-detail-empty, .dashboard-detail-loading { min-height: 80px; display: grid; place-items: center; border: 1px dashed var(--line, #dde4eb); border-radius: 9px; color: var(--ink-500, #64748b); font-size: 12px; text-align: center; padding: 10px; }
.dashboard-detail-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 15px 0; color: var(--ink-500, #64748b); font-size: 11px; }
.dashboard-detail-meta b { color: var(--ink-700, #334155); }
.dashboard-history-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.dashboard-history-table th, .dashboard-history-table td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft, #eef2f6); text-align: left; }
.dashboard-history-table th { color: var(--ink-500, #64748b); font-size: 10px; font-weight: 600; }
.metric-heading { display: flex; align-items: center; justify-content: space-between; color: var(--ink-700); font-size: 12px; }
.metric-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-style: normal;
  font-weight: 700;
}
.metric-icon.positive { background: var(--green-soft); }
.metric-sparkline { color: var(--blue); font-size: 28px; font-style: normal; letter-spacing: -5px; }
.metric-card > strong { display: block; margin: 7px 0 13px; font-size: 26px; line-height: 1; letter-spacing: -.03em; }
.metric-foot {
  min-height: 25px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-500);
  font-size: 10px;
}
.metric-foot b { color: var(--ink-950); font-size: 11px; }
.overview-card { overflow: hidden; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line-soft);
}
.section-heading h2 { margin: 0 0 2px; border: 0; padding: 0; color: var(--ink-950); font-size: 14px; }
.text-button { border: 0; background: transparent; color: var(--blue); font-size: 11px; cursor: pointer; }
.overview-empty { padding: 28px 16px; color: var(--ink-500); text-align: center; }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 5px; border-radius: 50%; background: var(--red-soft); color: var(--red); font-size: 10px; }
.attention-card { display: flex; min-height: 160px; flex-direction: column; }
.attention-list { flex: 1; }
.attention-group { border-bottom: 1px solid var(--line-soft); }
.attention-group:last-child { border-bottom: 0; }
.attention-item {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto 24px;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 12px 17px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.attention-item:hover, .attention-item:focus-visible { background: #fbfcfd; }
.attention-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--amber-soft); color: var(--amber); font-weight: 800; }
.attention-group.danger .attention-icon { background: var(--red-soft); color: var(--red); }
.attention-copy strong, .attention-copy span { display: block; }
.attention-copy strong { color: var(--ink-950); font-size: 12px; }
.attention-copy span { margin-top: 3px; color: var(--ink-500); font-size: 10px; }
.attention-count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--amber-soft); color: var(--amber); font-size: 10px; font-weight: 700; }
.attention-group.danger .attention-count { background: var(--red-soft); color: var(--red); }
.attention-action { color: var(--ink-500); font-size: 18px; transition: transform .18s ease; }
.attention-item[aria-expanded="true"] .attention-action { transform: rotate(180deg); }
.attention-ads { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; padding: 0 17px 17px 62px; }
.attention-ads[hidden] { display: none; }
.attention-ad-card {
  min-width: 0;
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.attention-ad-card:hover, .attention-ad-card:focus-visible { border-color: #b9cce0; box-shadow: 0 5px 16px rgba(16,36,62,.07); transform: translateY(-1px); }
.attention-ad-copy { min-width: 0; }
.attention-ad-copy strong, .attention-ad-copy span, .attention-ad-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-ad-copy strong { color: var(--ink-950); font-size: 11px; }
.attention-ad-copy span { margin-top: 4px; color: var(--ink-700); font-size: 10px; }
.attention-ad-copy small { margin-top: 4px; color: var(--ink-500); font-size: 9px; }
.attention-ad-action { color: var(--blue); font-size: 10px; white-space: nowrap; }
.activity-card { margin-top: 16px; }
.activity-list { display: flex; min-height: 70px; overflow-x: auto; }
.activity-item { min-width: 220px; display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 13px 16px; border-right: 1px solid var(--line-soft); }
.activity-arrow { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 700; }
.activity-arrow.down { background: var(--red-soft); color: var(--red); }
.activity-item strong, .activity-item span { display: block; }
.activity-item strong { max-width: 145px; overflow: hidden; color: var(--ink-950); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.activity-item span { margin-top: 2px; color: var(--ink-500); font-size: 9px; }
.activity-delta { color: var(--green); font-size: 10px; font-weight: 700; white-space: nowrap; }
.activity-delta.down { color: var(--red); }

#accountManagementArea { max-width: 1500px; margin: 0 auto 16px; }
#accountsList {
  margin: 0;
  padding: 14px 16px;
  background: rgba(255,255,255,.9);
}
#accountsList h2 {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  color: var(--ink-700);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
#accountsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
#accountsContainer .account-card {
  min-height: 74px;
  margin: 0;
  padding: 11px 12px;
  border-color: var(--line-soft);
  background: #fbfcfd;
}
#accountsContainer .account-card-name { color: var(--ink-950); font-size: 13px; }
#accountsContainer .account-card-meta { color: var(--ink-500); font-size: 10px; }
#accountsContainer .account-balances { gap: 6px; margin-top: 6px; }
#accountsContainer .balance-item { padding: 2px 7px; font-size: 10px; }
#accountsContainer .acc-badge { font-size: 9px; }
#accountsContainer .account-card-actions .btn { min-height: 30px; padding: 5px 8px; font-size: 10px; }
.card { padding: 20px; }
.card h2 { color: var(--ink-950); }
.form-group input, .form-group textarea, .form-group select, select {
  min-height: 40px;
  border-color: var(--line);
  border-radius: 8px;
  color: var(--ink-950);
  background: #fff;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,128,237,.1); }
.form-hint { color: var(--ink-500); }
.bid-card { border-color: var(--line); border-radius: 10px; background: #fff; scroll-margin: 28px; transition: border-color .2s ease, box-shadow .2s ease; }
.bid-header { min-height: 44px; }
.bid-card:hover { border-color: #c7d5e2; box-shadow: 0 5px 18px rgba(16,36,62,.05); }
.bid-card.bid-card-focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47,128,237,.12), 0 10px 28px rgba(16,36,62,.1); animation: bidCardFocus 1.1s ease-out; }
@keyframes bidCardFocus { 0% { transform: translateY(0); } 35% { transform: translateY(-3px); } 100% { transform: translateY(0); } }
.bid-bar-fill { background: var(--green); }
.step-card:not(.disabled) { border-color: rgba(7,148,85,.45); box-shadow: 0 5px 18px rgba(7,148,85,.08); }
.step-number { background: var(--green); }
.step-header { background: #f7faf9; }
.auth-screen {
  background:
    radial-gradient(circle at 15% 20%, rgba(47,128,237,.08), transparent 32%),
    radial-gradient(circle at 82% 80%, rgba(7,148,85,.09), transparent 30%),
    var(--canvas);
}
.auth-box { width: 420px; padding: 34px; border: 1px solid var(--line); box-shadow: 0 24px 70px rgba(16,36,62,.12); }
.auth-brand { justify-content: center; margin-bottom: 28px; }
.auth-brand h1 { margin: 0; font-size: 25px; }
.auth-brand .subtitle { margin: 2px 0 0; text-align: left; }

@media (max-width: 1480px) {
  .overview-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-engine-banner { grid-template-columns: 1fr auto; }
  .overview-engine-stats { grid-row: 2; grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line-soft); }
  .header-right .account-filter { display: none; }
  .dashboard-ad-summary { grid-template-columns: minmax(280px, 1fr) 118px 78px; }
  .dashboard-ad-metrics {
    grid-column: 1 / -1;
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
  }
  .dashboard-ad-metrics > div:first-child { border-left: 0; }
}
@media (max-width: 980px) {
  .app-main { margin-left: 76px; padding: 22px 20px 36px; }
  .app-sidebar { width: 76px; padding-inline: 9px; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .sidebar-brand strong, .sidebar-link span:last-child, .sidebar-user div, .sidebar-logout { display: none; }
  .brand-mark-sidebar { width: 44px; }
  .sidebar-link { justify-content: center; padding-inline: 0; }
  .sidebar-user { display: flex; justify-content: center; grid-template-columns: none; padding-inline: 0; }
  .bidding-list-heading { align-items: flex-start; flex-direction: column; }
  .bidding-list-controls { width: 100%; justify-content: flex-start; }
  .dashboard-ad-summary { grid-template-columns: minmax(250px, 1fr) 118px 78px; padding-left: 18px; }
}
@media (max-width: 760px) {
  .app-main { margin-left: 0; padding: 16px 14px 28px; }
  .app-sidebar { width: min(280px, 86vw); transform: translateX(-102%); transition: transform .2s ease; }
  .app-sidebar.open { transform: translateX(0); }
  .app-sidebar.open .sidebar-brand strong, .app-sidebar.open .sidebar-link span:last-child, .app-sidebar.open .sidebar-user div, .app-sidebar.open .sidebar-logout { display: block; }
  .app-sidebar.open .sidebar-link { justify-content: flex-start; padding-inline: 13px; }
  .app-sidebar.open .sidebar-user { display: grid; justify-content: initial; grid-template-columns: 38px 1fr 28px; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 850; border: 0; background: rgba(4,26,50,.48); }
  .sidebar-scrim.show { display: block; }
  .mobile-nav-toggle { display: inline-block; }
  .app-header { align-items: flex-start; }
  .header-right { padding-top: 0; }
  .header-right .icon-button, .header-right #addAccountGlobalBtn { display: none; }
  .header-right .btn-primary { min-height: 40px; padding: 9px 12px; font-size: 12px; }
  .breadcrumbs, .page-subtitle { display: none; }
  .app-header h1 { font-size: 23px; }
  .overview-engine-banner { grid-template-columns: 1fr; }
  .overview-engine-banner > .btn { width: 100%; }
  .overview-engine-stats { grid-row: auto; grid-column: auto; gap: 10px; }
  .overview-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 118px; }
  .bidding-account-control { width: 100%; }
  .bidding-account-control select { min-width: 0; flex: 1 1 auto; }
  .dashboard-sort-toolbar { width: 100%; }
  .dashboard-sort-toolbar select { min-width: 0; flex: 1 1 auto; }
  .attention-ads { grid-template-columns: 1fr; padding-left: 17px; }
  .attention-ad-action { display: none; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .file-row { flex-direction: column; }
  .modal { width: calc(100vw - 28px); }
  .dashboard-ad-summary {
    grid-template-columns: 1fr auto auto;
    gap: 16px 12px;
    padding: 18px 48px 18px 16px;
  }
  .dashboard-ad-identity { grid-column: 1 / -1; grid-template-columns: 82px minmax(0, 1fr); }
  .dashboard-ad-thumb { width: 82px; height: 92px; border-radius: 14px; }
  .dashboard-ad-position { grid-column: 2; }
  .dashboard-ad-bid { grid-column: 3; }
  .dashboard-ad-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-ad-metrics > div { min-height: 76px; padding: 10px 12px; }
  .dashboard-ad-metrics > div:nth-child(odd) { border-left: 0; }
  .dashboard-ad-average { grid-column: 1 / -1; margin: 8px 0 0; }
  .dashboard-ad-detail { margin-inline: 16px; }
  .dashboard-history-table { min-width: 560px; }
  .dashboard-history { overflow-x: auto; }
}
@media (max-width: 470px) {
  .overview-kpi-grid { grid-template-columns: 1fr; }
  .overview-engine-stats { grid-template-columns: 1fr 1fr; }
  .dashboard-sort-toolbar > label { display: none; }
  .bidding-list-controls > #refreshAdsBtn { width: 100%; }
  .header-right .btn-primary { max-width: 150px; }
  .dashboard-ad-summary { grid-template-columns: 1fr 1fr; padding-right: 48px; }
  .dashboard-ad-identity, .dashboard-ad-metrics { grid-column: 1 / -1; }
  .dashboard-ad-position { grid-column: 1; }
  .dashboard-ad-bid { grid-column: 2; }
  .dashboard-ad-expand { top: 10px; right: 10px; background: rgba(255,255,255,.88); }
}
