/* Sam Job Search — LinkedIn dark theme */

:root {
  --bg-app: #1b1f23;
  --bg-surface: #283035;
  --bg-surface-hover: #313a40;
  --border: #38434a;
  --text-primary: #e7e9ea;
  --text-secondary: #a1a9ad;
  --text-muted: #6e7781;
  --accent: #70b5f9;
  --accent-hover: #4a9ff0;
  --success: #2ea44f;
  --warning: #d29922;
  --danger: #f85149;
  --interview: #38c76a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3 { color: var(--text-primary); margin-top: 0; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

/* --- Layout --- */
.topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  height: 52px;
  gap: 20px;
}
.topbar__brand { font-weight: 600; font-size: 16px; color: var(--text-primary); }
.topbar__brand:hover { text-decoration: none; color: var(--accent); }
.topbar__nav { display: flex; gap: 16px; flex: 1; }
.topbar__nav a { color: var(--text-secondary); font-weight: 500; }
.topbar__nav a:hover { color: var(--accent); }
.topbar__logout { margin: 0; }

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}
.page-header h1 small { color: var(--text-secondary); font-weight: 400; font-size: 14px; }

/* --- Card --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  margin-bottom: 16px;
}
.card--warn { border-left: 3px solid var(--warning); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
  text-decoration: none;
}
.btn--primary { background: var(--accent); color: #0b1014; }
.btn--primary:hover { background: var(--accent-hover); color: #0b1014; text-decoration: none; }
.btn--secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn--secondary:hover { background: rgba(112, 181, 249, 0.1); text-decoration: none; }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: rgba(248, 81, 73, 0.12); text-decoration: none; }
.btn--sm { padding: 4px 10px; font-size: 12px; }

/* --- Flash --- */
.flash {
  background: rgba(210, 153, 34, 0.15);
  border-left: 3px solid var(--warning);
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.flash p { margin: 0; }

/* --- Login --- */
.login {
  max-width: 360px;
  margin: 80px auto 0;
  background: var(--bg-surface);
  padding: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.login h1 { text-align: center; margin-bottom: 24px; }
.login__form { display: flex; flex-direction: column; gap: 12px; }
.login__form label { font-weight: 600; }

/* --- Forms --- */
.form { display: flex; flex-direction: column; gap: 10px; }
.form label { font-weight: 600; font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
input, select, textarea {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
textarea { resize: vertical; }
.form__actions { display: flex; gap: 8px; margin-top: 8px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0 4px 0 0; }
.inline-contact-form {
  display: grid;
  grid-template-columns: repeat(5, 1fr) auto;
  gap: 6px;
  margin-top: 12px;
}
.inline-contact-form input { margin: 0; }
.inline-contact-form button { grid-column: 6; }
@media (max-width: 900px) {
  .inline-contact-form { grid-template-columns: 1fr 1fr; }
  .inline-contact-form button { grid-column: 1 / -1; }
}

/* --- Table --- */
.table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.table th, .table td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--text-secondary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.table tr:hover { background: var(--bg-surface-hover); }

/* --- Pills --- */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pill--warn { background: rgba(210, 153, 34, 0.2); color: var(--warning); }
.pill--not_started { background: rgba(161, 169, 173, 0.2); color: var(--text-secondary); }
.pill--applied { background: rgba(112, 181, 249, 0.2); color: var(--accent); }
.pill--responded { background: rgba(56, 199, 106, 0.2); color: var(--interview); }
.pill--interview { background: rgba(46, 164, 79, 0.25); color: var(--success); }
.pill--offer { background: rgba(46, 164, 79, 0.35); color: #2ecc71; }
.pill--rejected { background: rgba(248, 81, 73, 0.2); color: var(--danger); }
.pill--withdrawn { background: rgba(110, 119, 129, 0.2); color: var(--text-muted); }

/* --- Priority dots --- */
.priority-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.priority-dot--high { background: var(--danger); }
.priority-dot--medium { background: var(--warning); }
.priority-dot--low { background: var(--text-muted); }

/* --- Kanban --- */
.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
}
.kanban__col {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 12px;
  min-height: 200px;
}
.kanban__col-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.kanban__count { background: var(--bg-app); padding: 2px 8px; border-radius: 9999px; font-size: 11px; }
.kanban__empty { color: var(--text-muted); font-size: 12px; text-align: center; margin: 24px 0; }

.card--app {
  display: block;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 150ms ease;
}
.card--app:hover { background: var(--bg-surface-hover); text-decoration: none; }
.card--app__title { font-weight: 600; margin-bottom: 2px; }
.card--app__company { color: var(--text-secondary); font-size: 12px; }
.card--app__meta { color: var(--warning); font-size: 11px; margin-top: 4px; }

@media (max-width: 900px) {
  .kanban { grid-template-columns: 1fr; }
}

/* --- Overdue list --- */
.overdue-list { list-style: none; padding: 0; margin: 8px 0 0; }
.overdue-list li { padding: 6px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.overdue-list li:last-child { border-bottom: none; }

/* --- Meta list --- */
.meta { display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; margin: 0; }
.meta dt { color: var(--text-secondary); font-weight: 600; }
.meta dd { margin: 0; }

/* --- Timeline --- */
.timeline { list-style: none; padding: 0; margin: 16px 0 0; border-left: 2px solid var(--border); }
.timeline li { padding: 8px 0 8px 16px; position: relative; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px; top: 14px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline__time { color: var(--text-secondary); font-size: 11px; }
.timeline p { margin: 2px 0; }

/* --- Contacts --- */
.contacts { list-style: none; padding: 0; margin: 0; }
.contacts li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.contacts li:last-child { border-bottom: none; }

/* --- Misc --- */
.status-form { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.status-form label { margin: 0; font-weight: 600; }
.status-form select { width: auto; }

.empty { color: var(--text-muted); font-style: italic; }
.withdrawn { margin-top: 24px; color: var(--text-secondary); }
.withdrawn summary { cursor: pointer; }
.danger-zone { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }

/* --- Contact grid (company detail) --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.contact-grid .card { margin-bottom: 0; }
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.quick-search { list-style: none; padding: 0; margin: 8px 0 0; }
.quick-search li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.quick-search li:last-child { border-bottom: none; }
.quick-search a { display: block; }

.muted { color: var(--text-muted); }
.muted a { color: var(--accent); }

/* Form section headings inside the company form */
.form h2 {
  margin: 16px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.form h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

/* ========== Inbox ========== */
.inbox-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.inbox-header h1 { margin: 0; }
.inbox-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.card--inbox { margin-bottom: 8px; }
.inbox-job { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.inbox-job__main { flex: 1; }
.inbox-job__title { font-size: 15px; margin-bottom: 2px; }
.inbox-job__company { color: var(--text-secondary); font-size: 13px; }
.inbox-job__rationale { color: var(--text-secondary); font-size: 13px; margin-top: 4px; font-style: italic; }
.inbox-job__keywords { margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }
.inbox-job__meta { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.inbox-job__actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.score { font-weight: 600; font-size: 13px; padding: 1px 6px; border-radius: 4px; }
.score--high { background: #22543d; color: #68d391; }
.score--mid { background: #744210; color: #f6e05e; }
.score--low { background: #742a2a; color: #fc8181; }

.pill--ok { background: #22543d; color: #68d391; }
.pill--sm { font-size: 11px; padding: 1px 5px; }

.btn--danger { background: #742a2a; color: #fc8181; border: 1px solid #9b2c2c; }
.btn--danger:hover { background: #9b2c2c; }

.empty-state { color: var(--text-muted); text-align: center; padding: 32px 0; }

.card--accepted { border-left: 3px solid #68d391; }
.card--rejected { opacity: 0.6; }

/* ========== Draft section ========== */
.card--draft { border-left: 3px solid var(--accent); }
.draft-section { margin-bottom: 16px; }
.draft-section h3 { font-size: 13px; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 6px; }
.draft-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 12px; white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.draft-meta { color: var(--text-muted); font-size: 12px; margin-top: 8px; }

/* ========== Application Workflow ========== */
.card--workflow { border-left: 3px solid var(--accent); }
.workflow-hint { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }
.workflow-steps { display: flex; flex-direction: column; gap: 20px; }
.workflow-step { display: flex; gap: 14px; align-items: flex-start; }
.workflow-step__num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.workflow-step__body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.workflow-step__body strong { font-size: 15px; }

.copyable { cursor: pointer; position: relative; transition: outline 0.2s ease; }
.copyable:hover { outline: 1px dashed var(--accent); }
.copyable::after { content: 'click to copy'; position: absolute; top: 4px; right: 8px; font-size: 10px; color: var(--text-muted); opacity: 0; transition: opacity 0.2s; }
.copyable:hover::after { opacity: 1; }

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

.pill--status { font-size: 12px; padding: 2px 10px; border-radius: 10px; margin-left: 8px; }
.pill--not_started { background: #333; color: #aaa; }
.pill--applied { background: #1a3a5c; color: #63b3ed; }
.pill--responded { background: #2d3748; color: #90cdf4; }
.pill--interview { background: #744210; color: #f6e05e; }
.pill--offer { background: #22543d; color: #68d391; }
.pill--rejected { background: #742a2a; color: #fc8181; }
.pill--withdrawn { background: #333; color: #888; }

/* ========== Scan Stats ========== */
.scan-stats { margin-bottom: 16px; }
.scan-stats summary { cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.scan-stats__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px; margin-top: 12px;
}
.scan-stat { text-align: center; padding: 8px; background: var(--bg-body); border-radius: 6px; }
.scan-stat__value { font-size: 18px; font-weight: 700; color: var(--accent); }
.scan-stat__label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.scan-stats__error { margin-top: 10px; padding: 8px; background: #3a1a1a; color: #fc8181; border-radius: 4px; font-size: 12px; }

/* ========== Attachments ========== */
.attachments { display: flex; flex-wrap: wrap; gap: 12px; }
.attachment-item { display: flex; flex-direction: column; gap: 4px; }
.attachment-preview {
  width: 240px; height: 320px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; object-fit: contain;
}
.attachment-name { font-size: 12px; color: var(--accent); word-break: break-all; max-width: 240px; }
