/* Automatic job applying (التقديم التلقائي): banner in the jobs view + modal. Theme tokens only (dark & light). */
.aa-banner {
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg, 14px);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.aa-banner-content { display: flex; align-items: center; gap: 0.9rem; min-width: 0; flex: 1 1 280px; }
.aa-banner-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(99, 102, 241, 0.15); color: var(--tx-indigo); }
.aa-banner-title { margin: 0 0 0.2rem; font-size: 1.02rem; color: var(--text-main); }
.aa-banner-sub { margin: 0; font-size: 0.86rem; color: var(--text-muted); line-height: 1.6; }
.aa-pro-chip { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; background: rgba(245, 158, 11, 0.15); color: var(--tx-gold); vertical-align: middle; }
.aa-open-btn { white-space: nowrap; }
#modalAutoApply [hidden], .aa-banner[hidden] { display: none !important; }

.aa-dialog { max-width: 820px; width: calc(100% - 24px); }
.aa-body { max-height: calc(100vh - 170px); overflow-y: auto; }
.aa-note { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.7rem 0.85rem; border-radius: 10px; background: rgba(14, 165, 233, 0.1); color: var(--text-main); font-size: 0.85rem; line-height: 1.7; margin-bottom: 1rem; }
.aa-note svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--tx-cyan); margin-top: 3px; }
.aa-muted { color: var(--text-muted); font-size: 0.88rem; }

.aa-locked { text-align: center; padding: 0.5rem 0 0.25rem; }
.aa-locked h4 { margin: 0.4rem 0; color: var(--text-main); }
.aa-locked p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; margin: 0 auto 1rem; max-width: 560px; }
.aa-locked-icon { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: rgba(245, 158, 11, 0.15); color: var(--tx-gold); }
.aa-preview-box { text-align: start; border: 1px dashed var(--border-subtle); border-radius: 12px; padding: 0.85rem; margin: 0 auto 1rem; max-width: 560px; }
.aa-inline { display: flex; gap: 0.5rem; }
.aa-inline .form-input { flex: 1 1 auto; min-width: 0; }
.aa-inline .btn { flex: 0 0 auto; }
.aa-preview-result { font-size: 0.86rem; color: var(--text-main); margin-top: 0.5rem; min-height: 1.2em; line-height: 1.6; }
.aa-upgrade-btn { display: inline-flex; align-items: center; gap: 0.4rem; }

.aa-disabled-global, .aa-no-resume { padding: 0.7rem 0.85rem; border-radius: 10px; margin-bottom: 0.85rem; font-size: 0.88rem; line-height: 1.6; }
.aa-disabled-global { background: rgba(239, 68, 68, 0.1); color: var(--tx-danger); }
.aa-no-resume { background: rgba(245, 158, 11, 0.12); color: var(--text-main); display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }

.aa-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.aa-stat { border: 1px solid var(--border-subtle); border-radius: 10px; padding: 0.6rem 0.75rem; background: var(--bg-surface); min-width: 0; }
.aa-stat small { display: block; color: var(--text-muted); font-size: 0.75rem; }
.aa-stat strong { color: var(--text-main); font-size: 1rem; }
.aa-stat-action { display: flex; align-items: center; justify-content: center; }
.aa-stat-action .btn { width: 100%; white-space: normal; }

.aa-switch { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: 700; color: var(--text-main); margin-bottom: 0.9rem; }
.aa-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.aa-switch-track { width: 44px; height: 24px; border-radius: 999px; background: var(--border-subtle); position: relative; transition: background 0.2s; flex: 0 0 44px; border: 1px solid var(--border-subtle); }
.aa-switch-track::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: inset-inline-start 0.2s; }
.aa-switch input:checked + .aa-switch-track { background: var(--tx-emerald); }
.aa-switch input:checked + .aa-switch-track::after { inset-inline-start: 22px; }
.aa-switch input:focus-visible + .aa-switch-track { outline: 2px solid var(--border-active); outline-offset: 2px; }

.aa-grid { gap: 0.75rem 1rem; }
.aa-grid .form-group { min-width: 0; margin-bottom: 0; }
.aa-grid .form-label small { color: var(--text-muted); font-weight: 400; }
.aa-span-2 { grid-column: 1 / -1; }
.aa-check { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-main); font-size: 0.88rem; cursor: pointer; }
.aa-radios { display: flex; gap: 1rem; flex-wrap: wrap; padding-top: 0.35rem; }
.aa-range { width: 100%; accent-color: var(--tx-indigo); direction: ltr; }
.aa-actions { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 0.9rem; }

.aa-log-title { margin: 1.4rem 0 0.6rem; color: var(--text-main); font-size: 1rem; }
.aa-log { display: flex; flex-direction: column; gap: 0.5rem; }
.aa-log-item { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.7rem 0.85rem; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-surface); }
.aa-log-item > div { min-width: 0; flex: 1 1 220px; }
.aa-log-item strong { display: block; color: var(--text-main); font-size: 0.92rem; overflow-wrap: anywhere; }
.aa-log-item small { color: var(--text-muted); font-size: 0.78rem; }
.aa-log-side { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; flex: 0 0 auto; }
.aa-badge-auto { display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: rgba(99, 102, 241, 0.15); color: var(--tx-indigo); white-space: nowrap; margin-inline-start: 0.35rem; vertical-align: middle; }
.my-app-status.s-withdrawn { background: rgba(148, 163, 184, 0.18); color: var(--text-muted); }

@media (max-width: 640px) {
  .aa-banner { padding: 0.9rem; }
  .aa-open-btn { width: 100%; justify-content: center; }
  .aa-grid { grid-template-columns: 1fr !important; }
  .aa-stats { grid-template-columns: 1fr 1fr; }
  .aa-stat-action { grid-column: 1 / -1; }
  .aa-actions .btn { flex: 1 1 100%; justify-content: center; }
  .aa-inline { flex-direction: column; }
}
