@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --ink: #2D3748;
  --paper: #BFD7EA;
  --warning: #e21833;
  --light_ink: #454545;
  --selected: #bdbdbd;
  --success: #16a34a;
  --border: #F4F6F8;
  --card: #4A6FA5;
}


* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  width: 340px;
  min-height: 480px;
  color: var(--ink);
}

.container {
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 7px;
}

.logo-icon {
  width: 28px; height: 28px;
  background: var(--ink);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.logo-name {
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--warning);
  transition: background 0.3s;
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(22,163,74,0.2);
  animation: breathe 2s infinite;
}

@keyframes breathe {
  0%,100% { box-shadow: 0 0 0 2px rgba(22,163,74,0.2); }
  50% { box-shadow: 0 0 0 4px rgba(22,163,74,0.1); }
}

.status-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: var(--ink);
}

.connect-banner {
  background: var(--paper);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
}

.connect-banner-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 2px;
}

.connect-banner-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: var(--light_ink);
}

.btn-connect {
  background: var(--warning);
  color: var(--border);
  border: none;
  padding: 8px 14px;
  border-radius: 7px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.btn-connect:hover {
  transform: translateY(-1px);
}

.btn-connect:disabled {
  background: var(--success);
  box-shadow: none;
  transform: none;
  cursor: default;
}

.connected-banner {
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
}

.connected-pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:0.4; transform:scale(0.7); }
}

.spreadsheet-link {
  margin-top: 2px;
}

.btn-sheets {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 9px;
  background: var(--border);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.15s;
}

.btn-sheets:hover {
  background: var(--success);
  border-color: var(--success);
  color: var(--border);
  transform: translateY(-1px);
}

.btn-sheets-icon { font-size: 13px; }

.stats-row {
  display: flex;
  gap: 6px;
}

.stat-card {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 8px;
  text-align: center;
}

.stat-num {
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--paper);
  line-height: 1;
  margin-bottom: 3px;
  transition: transform 0.2s ease;
}

.stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--paper);
  opacity: 0.85;
}

.stat-card.bump .stat-num {
  animation: statBump 0.35s ease;
}

@keyframes statBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.search-bar {
  position: relative;
}

.search-bar .form-input {
  padding-left: 28px;
  background: var(--border);
}

.search-bar::before {
  content: "🔍";
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.6;
  pointer-events: none;
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--border);
  padding: 3px;
  border-radius: 8px;
}

.tab {
  flex: 1;
  padding: 7px 4px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.tab.active {
  background: var(--card);
  color: var(--paper);
  font-weight: 600;
}

.tab-content {
  display: none;
  max-height: 220px;
  overflow-y: auto;
}

.tab-content.active { display: block; }

.tab-content::-webkit-scrollbar { width: 4px; }
.tab-content::-webkit-scrollbar-track { background: transparent; }
.tab-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--ink);
}

.empty-icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 5px;
}

.empty-state small {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: var(--ink);
  line-height: 1.5;
  display: block;
}

.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.job-card {
  background: var(--border);
  border: 1px solid var(--card);
  border-radius: 9px;
  padding: 11px 12px;
  cursor: pointer;
  transition: all 0.18s;
  animation: cardIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.job-card:hover {
  border-color: var(--warning);
  box-shadow: 0 2px 10px rgba(232,93,38,0.12);
  transform: translateY(-1px);
}

.job-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.job-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  flex: 1;
}

.job-date {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.job-card-buttons {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.job-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 5px;
  color: var(--ink);
  flex-shrink: 0;
  transition: all 0.15s;
}

.job-edit-btn:hover {
  color: var(--success);
  background: var(--border);
}

.job-edit-container {
  display: none;
}

.job-edit-container.open {
  display: block;
  margin-top: 8px;
}

.job-edit-form {
  animation: cardIn 0.2s ease both;
}

.job-edit-form .form-row:last-of-type {
  gap: 8px;
}

.btn-edit-cancel {
  flex: 1;
}

.btn-edit-save {
  flex: 1;
  box-shadow: none;
}

.job-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 5px;
  color: var(--ink);
  flex-shrink: 0;
  transition: all 0.15s;
}

.job-delete-btn:hover {
  color: var(--warning);
  background: var(--border);
}

.job-company {
  font-size: 11.5px;
  color: var(--accent2);
  font-weight: 500;
  margin-bottom: 3px;
}

.job-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.job-location, .job-salary {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: var(--ink);
}

.job-status-chip {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--border);
  color: var(--warning);
  border: 1px solid var(--border);
  font-weight: 500;
  margin-top: 5px;
}

.job-status-chip.saved {
  background: var(--border);
  color: var(--ink);
}

.manual-entry {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.manual-entry-toggle {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--paper);
  cursor: pointer;
  transition: all 0.15s;
}

.manual-entry-toggle:hover {
  border-color: var(--success);
  color: var(--ink);
}

/* Add Job is the primary action of the popup — give it more visual weight */
.manual-entry-toggle.btn-add-job {
  padding: 12px;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  box-shadow: 0 3px 10px rgba(74,111,165,0.35);
}

.manual-entry-toggle.btn-add-job:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(74,111,165,0.45);
}

/* Import from an old spreadsheet is rare — a small icon button living next to
   the connection status dot, with a themed tooltip instead of a text label */
.manual-entry-compact {
  border-top: none;
  padding-top: 2px;
}

.status-indicator {
  position: relative;
}

.import-icon-btn {
  position: relative;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-left: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px dashed var(--card);
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  color: var(--light_ink);
  cursor: pointer;
  transition: all 0.15s;
}

.import-icon-btn:hover {
  border-style: solid;
  border-color: var(--ink);
  color: var(--ink);
  background: var(--border);
}

.import-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  max-width: 150px;
  background: var(--ink);
  color: var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  padding: 6px 9px;
  border-radius: 6px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  pointer-events: none;
  z-index: 10;
}

.import-icon-btn:hover .import-tooltip,
.import-icon-btn:focus-visible .import-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.manual-entry-form {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
}

.form-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.form-row .form-input {
  flex: 1;
}

.field-with-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.field-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 7px 8px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--selected);
}

textarea.form-input {
  resize: vertical;
  min-height: 42px;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.4;
}

.btn-manual-submit {
  width: 100%;
  box-shadow: none;
  margin-top: 2px;
}

.manual-feedback {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  text-align: center;
  min-height: 12px;
  color: var(--ink);
}

.manual-feedback.success { color: var(--success); }
.manual-feedback.error { color: var(--warning); }

.import-mapping {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
  max-height: 150px;
  overflow-y: auto;
}

.import-mapping::-webkit-scrollbar { width: 4px; }
.import-mapping::-webkit-scrollbar-track { background: transparent; }
.import-mapping::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.import-map-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  padding: 5px 8px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.import-map-old {
  font-weight: 500;
  color: var(--ink);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-map-arrow {
  color: var(--ink);
  flex-shrink: 0;
}

.import-map-target {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.import-map-target.matched {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.import-map-target.new-column {
  background: #fff8db;
  color: var(--ink);
}

.import-summary {
  font-family: 'DM Sans', sans-serif;
  font-size: 9.5px;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 2px;
}

.btn-import-confirm {
  width: 100%;
  box-shadow: none;
  margin-top: 4px;
}

.actions {
  display: flex;
  gap: 6px;
  color: var(--paper);
}

.btn-sheets {
  display: flex;
  background: var(--paper);
  border: 1px solid var(--border);
}

.btn-ghost {
  flex: 1;
  padding: 7px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ghost:hover {
  background: var(--card);
  color: var(--ink);
  border-color: var(--ink);
}

.btn-ghost-danger:hover {
  color: var(--warning);
  border-color: var(--warning);
  background: #fdeaec;
}

.btn-icon-only {
  flex: 0 0 auto;
  width: 38px;
  padding: 7px 0;
  text-align: center;
  font-size: 14px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 55, 72, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: modalFadeIn 0.15s ease both;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  max-width: 260px;
  box-shadow: var(--ink);
  animation: modalCardIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modalCardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.modal-message {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.modal-actions .btn-ghost,
.modal-actions .btn-connect {
  flex: 1;
  box-shadow: none;
}