@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* Neutral ramp — warmer and lower-contrast than pure slate. */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-sunken: #fafbfc;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --line: #eef0f3;
  --text: #101828;
  --text-secondary: #475467;
  --text-muted: #98a2b3;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff4ff;
  --primary-border: #c7d7fe;

  --header-bg: #0b1220;
  --header-text: #f8fafc;

  --success: #12b76a;
  --success-soft: #ecfdf3;
  --warn: #f79009;
  --warn-soft: #fffaeb;
  --danger: #f04438;
  --danger-soft: #fef3f2;

  /* Layered shadows read as depth rather than a grey blur. */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.14);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --shell: 1320px;
  --shell-wide: 1760px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ——— App shell ——— */
.app-header {
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 28px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--header-text);
  flex-shrink: 0;
}

.app-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-brand-text {
  font-size: 0.95rem;
  font-weight: 600;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: #9aa4b2;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 7px 13px;
  border-radius: var(--radius-xs);
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
  color: var(--header-text);
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  color: var(--header-text);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

.app-user-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.points-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.15);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.btn-nav-logout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-nav-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.app-main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 30px 28px 56px;
}

/* Pages that need the room (the calendar) opt into the wide shell. */
body.is-wide .app-header-inner,
body.is-wide .app-main {
  max-width: var(--shell-wide);
}

/* ——— Page layout ——— */
.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 5px;
}

.page-header p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 560px;
}

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 30px;
}

/* Wide pages lay out their own cards; the wrapper should not add a second frame. */
.container.wide {
  max-width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.card + .card {
  margin-top: 20px;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ——— Forms ——— */
.form-group {
  margin-bottom: 18px;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.55;
}

#profileText {
  min-height: 260px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-hint {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.field-hint a {
  color: var(--primary);
  font-weight: 500;
}

/* ——— Buttons ——— */
button,
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

button:active,
.btn:active {
  transform: scale(0.98);
}

button.primary,
.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

button.primary:hover,
.btn.primary:hover {
  background: var(--primary-hover);
}

.btn-generate {
  width: 100%;
  padding: 14px 18px;
  font-size: 0.95rem;
}

button.secondary,
.btn.secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

button.secondary:hover,
.btn.secondary:hover {
  background: #e2e8f0;
}

button.danger,
.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
}

button.danger:hover,
.btn.danger:hover {
  background: #fee2e2;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.form-actions .btn {
  flex: 1;
  min-width: 120px;
}

.btn-block {
  width: 100%;
}

/* ——— Status ——— */
#status,
.status-message {
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  min-height: 20px;
}

#status.success,
.status-message.success {
  color: var(--success);
}

#status.error,
.status-message.error {
  color: var(--danger);
}

.footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ——— Profile layout ——— */
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.profile-list-header {
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-list button {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  background: var(--surface);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
}

.profile-list button:last-child {
  border-bottom: none;
}

.profile-list button:hover {
  background: var(--bg);
}

.profile-list button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.profile-list button .meta {
  display: block;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 400;
}

.empty-state {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ——— Dashboard / Excel table ——— */
.dashboard-panel {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.dashboard-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-strong);
}

.dashboard-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-panel-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.dashboard-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
}

.dashboard-search label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}

.dashboard-search input {
  flex: 1;
  min-width: 180px;
  padding: 7px 10px;
  font-size: 0.85rem;
  border-radius: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}

.applications-table-wrap {
  overflow: auto;
  max-height: 65vh;
}

.applications-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-family: "Segoe UI", Calibri, var(--font);
}

.excel-table th,
.excel-table td {
  padding: 6px 10px;
  border: 1px solid #d4d4d4;
  text-align: left;
  vertical-align: middle;
  background: var(--surface);
  color: var(--text);
  line-height: 1.35;
}

.excel-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 600;
  border-color: var(--border-strong);
}

.excel-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.excel-table tbody tr:hover td {
  background: #e8f4fc;
}

.col-date {
  width: 170px;
  white-space: nowrap;
}

.col-company {
  width: 180px;
  font-weight: 600;
}

.col-copy {
  width: 110px;
  text-align: center;
}

.col-action {
  width: 100px;
  text-align: center;
  white-space: nowrap;
}

.excel-btn {
  min-width: 72px;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: #f8fafc;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}

.excel-btn:hover {
  background: #e2e8f0;
}

.excel-btn.copied {
  background: var(--success-soft);
  border-color: #a7f3d0;
  color: var(--success);
}

.excel-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
}

.excel-link:hover {
  text-decoration: underline;
}

.excel-sidebar .profile-list-header {
  background: #f1f5f9;
}

/* ——— Generate page extras ——— */
.profile-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.profile-summary:empty {
  display: none;
}

.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: #1e40af;
}

.alert-banner a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.alert-banner a:hover {
  text-decoration: underline;
}

/* ——— Resume insights (post-generation) ——— */
.results-section {
  margin-top: 32px;
}

.results-header {
  margin-bottom: 20px;
}

.results-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ats-card {
  grid-row: span 1;
}

.questions-card {
  grid-column: 1 / -1;
}

.ats-score-display {
  text-align: center;
  padding: 8px 0 20px;
}

.ats-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px 0 20px;
}

.ats-compare-item {
  text-align: center;
}

.ats-compare-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.3;
}

.ats-compare-delta {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  min-width: 52px;
  text-align: center;
}

.ats-compare-delta[data-trend='up'] {
  color: var(--success);
  background: var(--success-soft);
  border-color: #a7f3d0;
}

.ats-compare-delta[data-trend='down'] {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fecaca;
}

.ats-compare-delta[data-trend='neutral'] {
  color: var(--text-secondary);
}

.ats-ring {
  --ats-score: 0;
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    var(--ats-color, #1d4ed8) calc(var(--ats-score) * 1%),
    #e2e8f0 calc(var(--ats-score) * 1%)
  );
  position: relative;
}

.ats-ring-sm {
  width: 96px;
  height: 96px;
  margin: 0 auto;
}

.ats-ring-sm::before {
  inset: 8px;
}

.ats-ring-sm span {
  font-size: 1.35rem;
  position: relative;
  z-index: 1;
}

.ats-ring span {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

#atsMatchValue {
  font-size: 1.75rem;
}

.ats-ring::before {
  content: '';
  position: absolute;
  inset: 10px;
  background: var(--surface);
  border-radius: 50%;
}

.ats-ring[data-level='high'] {
  --ats-color: #059669;
}

.ats-ring[data-level='mid'] {
  --ats-color: #d97706;
}

.ats-ring[data-level='low'] {
  --ats-color: #dc2626;
}

.ats-caption {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.missing-skills h3 .subtle {
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.missing-skills h3,
.diff-section h3 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.missing-skills {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.chip-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list .chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.chip-list.warning .chip {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.chip-list.keywords .chip {
  background: var(--primary-soft);
  border-color: #bfdbfe;
  color: #1e40af;
}

.diff-section + .diff-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.diff-list {
  list-style: none;
}

.diff-list li {
  padding: 6px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.diff-list li:last-child {
  border-bottom: none;
}

.diff-list li.diff-added::before {
  content: '+ ';
  color: var(--success);
  font-weight: 700;
}

.diff-list li.diff-removed::before {
  content: '− ';
  color: var(--danger);
  font-weight: 700;
}

.diff-list .empty-item,
.chip-list .empty-item {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
}

.questions-list {
  margin: 0;
  padding-left: 1.25rem;
  max-height: 420px;
  overflow-y: auto;
}

.questions-list li {
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
  padding-right: 8px;
}

.questions-list li::marker {
  color: var(--primary);
  font-weight: 600;
}

/* ——— Import job page ——— */
.btn-fetch {
  width: 100%;
}

.job-results {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.job-results .card + .card {
  margin-top: 0;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.meta-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.warnings-box {
  margin-top: 16px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: #92400e;
  line-height: 1.45;
}

.warnings-box p + p {
  margin-top: 6px;
}

.job-readonly {
  min-height: 320px;
  background: var(--bg);
  font-size: 0.88rem;
  line-height: 1.55;
}

.questions-on-site {
  list-style: none;
  margin: 0;
  padding: 0;
}

.questions-on-site li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
}

.questions-on-site li:last-child {
  border-bottom: none;
}

.questions-on-site .q-num {
  font-weight: 700;
  color: var(--primary);
  margin-right: 6px;
}

.questions-on-site .empty-item {
  color: var(--text-secondary);
  font-style: italic;
}

.fetch-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.fetch-row input {
  flex: 1;
  min-width: 0;
}

.fetch-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.nested-card {
  margin-top: 20px;
  margin-bottom: 20px;
  background: var(--bg);
  border-color: var(--border);
  box-shadow: none;
}

/* ——— Generate page (compact) ——— */
.generate-card {
  padding: 24px;
}

.form-section {
  margin-bottom: 0;
}

.form-section-fetch {
  padding-bottom: 0;
}

.form-section-ask {
  padding-top: 0;
}

.form-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.form-group-compact {
  margin-bottom: 14px;
}

.form-group-compact:last-child {
  margin-bottom: 0;
}

.section-label,
.section-heading {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.section-heading {
  font-size: 1.1rem;
  text-transform: none;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 2px;
}

.generate-card label {
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.generate-card select,
.generate-card input,
.generate-card textarea {
  padding: 9px 12px;
  font-size: 0.88rem;
}

.job-desc-input {
  min-height: 140px;
}

.btn-compact {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.generate-status {
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 0.85rem;
  min-height: 18px;
}

.generate-status.pending {
  color: var(--text-muted);
}

.job-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.job-queue {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.job-queue-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt, #f8fafc);
}

.job-queue-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.job-queue-num {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
}

.btn-text:hover {
  text-decoration: underline;
}

.batch-results {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.batch-results .batch-ok {
  color: #15803d;
  margin-bottom: 4px;
}

.generate-footer-hint {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 0.78rem;
}

.single-question-input {
  min-height: 72px;
}

.app-a-text-compact {
  min-height: 88px;
  margin-bottom: 8px;
}

.answer-actions-compact {
  margin-top: 0;
}

.answer-actions-compact .btn {
  flex: 0 1 auto;
  min-width: 88px;
}

.single-answer-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.application-questions-section {
  margin-top: 24px;
}

.application-questions-header h2 {
  margin-bottom: 0;
}

.application-questions-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.application-questions-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.app-q-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.saved-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.answer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.answer-actions .btn {
  flex: 1;
  min-width: 100px;
}

.application-answers-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.application-answer-card {
  margin-top: 0;
}

.app-q-label,
.app-a-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.app-a-label {
  margin-top: 14px;
}

.app-q-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0;
}

.app-a-text {
  min-height: 100px;
  font-size: 0.88rem;
  line-height: 1.5;
  background: var(--bg);
  margin-bottom: 10px;
}

.btn-copy-answer {
  width: auto;
  padding: 8px 14px;
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .meta-grid {
    grid-template-columns: 1fr;
  }
}

/* ——— Responsive ——— */
@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-search {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .app-header-inner {
    padding: 0 16px;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .app-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .app-main {
    padding: 20px 16px 32px;
  }

  .container,
  .card {
    padding: 20px;
  }

  .page-header h1 {
    font-size: 1.4rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .ats-compare {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ats-compare-delta {
    margin: 0 auto;
  }

  .questions-card {
    grid-column: auto;
  }

  .fetch-row {
    flex-direction: column;
  }

  .fetch-row .btn {
    width: 100%;
  }

  .application-questions-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ——— Login ——— */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 100%);
}

.login-main {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.login-card {
  padding: 32px;
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand h1 {
  font-size: 1.35rem;
  margin-top: 12px;
}

.login-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 6px;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-error {
  color: var(--danger);
  font-size: 0.88rem;
  margin-top: 12px;
}

.login-hint {
  text-align: center;
  margin-top: 16px;
}

.login-footer-link {
  text-align: center;
  margin-top: 16px;
  font-size: 0.9rem;
}

.register-success {
  color: #15803d;
  font-size: 0.9rem;
  margin-top: 12px;
  text-align: center;
}

/* ——— Admin ——— */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
}

.admin-tab.active {
  background: var(--primary-soft);
  border-color: #93c5fd;
  color: var(--primary);
}

.admin-panel {
  margin-bottom: 20px;
}

.admin-detail-panel {
  margin-top: 20px;
}

.admin-charge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.admin-charge-row input[type='number'] {
  width: 120px;
}

.admin-charge-row input[type='text'] {
  flex: 1;
  min-width: 160px;
}

.admin-subheading {
  font-size: 0.95rem;
  margin: 20px 0 10px;
}

.admin-profile-list {
  display: grid;
  gap: 10px;
}

.admin-profile-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.admin-app-group {
  margin-bottom: 24px;
}

.admin-app-group h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.admin-create-form {
  max-width: 520px;
}

.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-permissions {
  margin: 16px 0;
}

.admin-permissions-create {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.admin-perm-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-perm-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 10px;
}

.admin-perm-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ——— Crypto deposit ——— */
.deposit-layout {
  display: grid;
  gap: 20px;
}

.deposit-card {
  max-width: 640px;
}

.deposit-rate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
  background: var(--primary-soft);
  border: 1px solid #93c5fd;
  border-radius: var(--radius-sm);
}

.deposit-rate-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.deposit-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deposit-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.deposit-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.deposit-step-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.deposit-address-row {
  display: flex;
  gap: 8px;
}

.deposit-address-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
}

.deposit-meta {
  display: flex;
  gap: 24px;
  font-size: 0.9rem;
}

.deposit-meta-label {
  color: var(--text-muted);
  margin-right: 6px;
}

.deposit-status {
  margin-top: 12px;
  font-size: 0.9rem;
}

.deposit-status-success {
  color: #15803d;
}

.deposit-status-error {
  color: #b91c1c;
}

.deposit-status-pending {
  color: var(--text-muted);
}

.deposit-tx-cell a {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
}

.deposit-history-card {
  max-width: 720px;
}

.account-card {
  max-width: 480px;
}

.account-email {
  margin: -4px 0 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-msg {
  margin-top: 12px;
  font-size: 0.9rem;
}

.account-msg-success {
  color: #15803d;
}

.account-msg-error {
  color: #b91c1c;
}

.admin-settings-form {
  max-width: 360px;
}

.admin-usage-stats {
  margin-bottom: 16px;
}

.admin-usage-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 12px 14px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.admin-limits-panel {
  margin: 20px 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.admin-limits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.admin-adjust-row {
  flex-wrap: wrap;
}

.admin-adjust-select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--surface);
}

.activity-details {
  max-width: 320px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--danger, #dc2626);
  color: #fff;
  border-radius: 999px;
}

.registrations-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.registration-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt, #f8fafc);
}

.registration-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.registration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.registration-actions input[type='number'] {
  width: 120px;
}

.admin-profile-select {
  min-width: 220px;
  max-width: 360px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.admin-shared-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.admin-shared-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.admin-shared-profiles {
  margin: 20px 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
