*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f0f2f7;
  --white: #ffffff;
  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --blue: #3b82f6;
  --blue-hover: #2563eb;
  --blue-light: #eff6ff;

  --green: #10b981;
  --green-hover: #059669;
  --green-light: #d1fae5;
  --green-text: #065f46;

  --red: #ef4444;
  --red-hover: #dc2626;
  --red-light: #fee2e2;
  --red-text: #991b1b;

  --grey-badge-bg: #f3f4f6;
  --grey-badge-tx: #6b7280;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10), 0 3px 6px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --transition: 0.18s ease;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --white: #1e293b;
  --border: #334155;
  --border-hover: #475569;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --blue-light: #1e3a5f;
  --green-light: #064e3b;
  --green-text: #6ee7b7;
  --red-light: #7f1d1d;
  --red-text: #fca5a5;

  --grey-badge-bg: #334155;
  --grey-badge-tx: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5), 0 3px 6px rgba(0, 0, 0, 0.4);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}



.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.4px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.theme-toggle {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.dashboard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.dashboard:hover {
  box-shadow: var(--shadow-md);
}

.stat-cell {
  padding: 20px 24px;
  border-right: 1px solid var(--border);
  position: relative;
  transition: background var(--transition);
  cursor: default;
}

.stat-cell:last-child {
  border-right: none;
}

.stat-cell::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  border-radius: 2px;
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-cell.total::after {
  background: var(--blue);
}

.stat-cell.interview::after {
  background: var(--green);
}

.stat-cell.rejected::after {
  background: var(--red);
}

.stat-cell:hover {
  background: #fafafa;
}

.stat-cell:hover::after {
  opacity: 1;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  transition: transform var(--transition);
}

.stat-cell:hover .stat-value {
  transform: scale(1.05);
}

.stat-value.green {
  color: var(--green);
}

.stat-value.red {
  color: var(--red);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.section-count {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  background: var(--grey-badge-bg);
  padding: 3px 10px;
  border-radius: 99px;
  transition: all var(--transition);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  width: fit-content;
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  padding: 6px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg);
}

.tab-btn.active {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.35);
}

#cards-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.job-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: default;
  transition:
    box-shadow var(--transition),
    border-color var(--transition),
    transform var(--transition);
  animation: slideIn 0.22s ease both;
  position: relative;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.job-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.job-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--blue);
  opacity: 0;
  transition: opacity var(--transition);
}

.job-card:hover::before {
  opacity: 1;
}

.job-card.status-interview::before {
  background: var(--green);
  opacity: 1;
}

.job-card.status-rejected::before {
  background: var(--red);
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card-header-left {
  flex: 1;
  min-width: 0;
}

.company-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-position {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 400;
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #d1d5db;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.delete-btn:hover {
  color: var(--red);
  background: var(--red-light);
  transform: scale(1.1);
}

.delete-btn:active {
  transform: scale(0.95);
}

.job-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.meta-dot {
  width: 3px;
  height: 3px;
  background: #d1d5db;
  border-radius: 50%;
  flex-shrink: 0;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.meta-chip svg {
  opacity: 0.55;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  width: fit-content;
  transition: all var(--transition);
}

.badge-not-applied {
  background: var(--grey-badge-bg);
  color: var(--grey-badge-tx);
}

.badge-interview {
  background: var(--green-light);
  color: var(--green-text);
}

.badge-rejected {
  background: var(--red-light);
  color: var(--red-text);
}

.job-description {
  font-size: 12.5px;
  color: #4b5563;
  line-height: 1.7;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.action-btn {
  padding: 6px 18px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
  overflow: hidden;
}

.action-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  opacity: 0;
  transition: opacity 0.1s;
}

.action-btn:active::after {
  opacity: 1;
}

.btn-interview {
  background: transparent;
  border: 1.5px solid var(--green);
  color: var(--green-hover);
}

.btn-interview:hover {
  background: var(--green);
  color: #fff;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-interview:active {
  transform: translateY(0);
}

.btn-interview.active {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-rejected {
  background: transparent;
  border: 1.5px solid var(--red);
  color: var(--red-hover);
}

.btn-rejected:hover {
  background: var(--red);
  color: #fff;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-rejected:active {
  transform: translateY(0);
}

.btn-rejected.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.empty-state {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 20px;
  text-align: center;
  min-height: 260px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.empty-state.show {
  display: flex;
}

.empty-icon {
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  max-width: 240px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.22s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

[data-theme="dark"] .toast {
  background: #f1f5f9;
  color: #0f172a;
}

@media (max-width: 640px) {
  .page {
    padding: 20px 14px 48px;
  }

  .page-title {
    font-size: 17px;
  }

  .dashboard {
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
  }

  .stat-cell {
    padding: 14px 16px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-label {
    font-size: 10.5px;
  }

  .tabs {
    width: 100%;
    justify-content: stretch;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    font-size: 12px;
  }

  .job-card {
    padding: 14px 14px 12px;
  }

  .company-name {
    font-size: 13.5px;
  }

  .empty-icon img {
    max-width: 180px;
    height: auto;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}

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

  .stat-cell {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .stat-cell:nth-child(2) {
    border-right: 1px solid var(--border);
  }

  .stat-cell:nth-child(3) {
    border-right: 1px solid var(--border);
  }

  .stat-cell:last-child {
    border-bottom: none;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

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

  .stat-cell {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .stat-cell:last-child {
    border-bottom: none;
  }

  .stat-cell::after {
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    height: 100%;
    width: 3px;
    border-radius: 0;
  }

  .brand-name {
    display: none;
  }

  .card-header {
    flex-wrap: wrap;
  }

  .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
  }

  .job-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .meta-dot {
    display: none;
  }

  .card-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }

  .empty-icon img {
    max-width: 140px;
  }
}

@media (max-width: 360px) {
  .page-title {
    font-size: 15px;
  }

  .stat-value {
    font-size: 20px;
  }

  .tab-btn {
    padding: 6px 6px;
    font-size: 11px;
  }

  .job-card {
    padding: 12px 12px 10px;
  }

  .company-name {
    font-size: 13px;
  }

  .job-position {
    font-size: 11.5px;
  }
}