/**
 * style.css
 * HiCandidate™ ATS-Demo – neutrales, generisches ATS-Design.
 * Marken-Akzentfarbe (#E1F561) ausschließlich für den HiCandidate™-Block
 * und dezente Akzente in der Sidebar-Navigation.
 */

:root {
  --color-bg: #f3f4f7;
  --color-surface: #ffffff;
  --color-border: #e2e4e9;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-link: #1a6fc4;
  --color-row-hover: #eef4fd;
  --color-accent: #e1f561;
  --color-accent-bg: #f9fde8;
  --radius: 8px;
  --spacing: 16px;
  --header-height: 76px;
  --sidebar-width: 220px;
  --sidebar-bg: #12172b;
  --sidebar-text: #aab2c8;
  --sidebar-active-bg: rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; }
button { font-family: inherit; }

/* ── App Shell (Sidebar + Main) ───────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.app-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
}

.app-sidebar__brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-accent);
  color: #12172b;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-sidebar__brand-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.app-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--sidebar-text);
  background: none;
  border: none;
  border-left: 3px solid transparent;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.app-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.app-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.app-nav-item--active {
  background: var(--sidebar-active-bg);
  color: #fff;
  border-left-color: var(--color-accent);
  font-weight: 600;
}

.app-nav-item--disabled {
  opacity: 0.62;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.company-logo {
  height: 52px;
  max-width: 260px;
  object-fit: contain;
  object-position: left center;
}

.site-header__spacer {
  flex: 1;
}

.app-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.app-user-badge__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eef1f8;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.72rem;
  flex-shrink: 0;
}

/* ── Page layout ─────────────────────────────────────────────── */
.job-list-page,
.job-detail-page {
  max-width: 1080px;
  margin: 32px auto;
  padding: 0 var(--spacing);
  width: 100%;
}

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

.page-heading {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.4;
}

.btn--primary {
  background: #2563eb;
  color: #fff;
}

.btn--primary:hover { background: #1d4ed8; }

.btn--ghost {
  background: #fff;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--ghost:hover { background: #f5f5f7; }

.btn--danger-ghost {
  background: #fff;
  color: #c0392b;
  border-color: #f1c3bb;
}

.btn--danger-ghost:hover { background: #fdf1ef; }

/* ── Job List ────────────────────────────────────────────────── */
.job-list {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.job-list-header,
.job-row {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 0.9fr 0.8fr;
  gap: 12px;
  padding: 13px 20px;
  align-items: center;
}

.job-list-header {
  background: #f7f8fb;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  user-select: none;
}

.job-row {
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
  transition: background 0.12s;
}

.job-row:last-child { border-bottom: none; }

.job-row--clickable {
  cursor: pointer;
  text-decoration: none;
  display: grid;
}

.job-row--clickable:hover {
  background: var(--color-row-hover);
}

.job-row--clickable .job-title {
  color: var(--color-link);
  font-weight: 500;
}

.job-row--clickable:hover .job-title {
  text-decoration: underline;
}

.job-row--disabled {
  cursor: default;
}

.job-row--disabled .job-title {
  color: var(--color-text);
  font-weight: 400;
}

.job-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8125rem;
  background: #eef1f8;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill--active {
  background: #e6f6ea;
  color: #1a7f3c;
}

/* ── Back link ───────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-link);
  font-size: 0.9rem;
  margin-bottom: 20px;
  font-weight: 500;
}

.back-link:hover { text-decoration: underline; }

/* ── Job Edit Header ─────────────────────────────────────────── */
.job-edit__crumb { margin-bottom: 4px; }

.job-edit__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.job-edit__title {
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.job-edit__subline {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.job-edit__reqid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #eef1f8;
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--color-text);
}

.job-edit__lang select {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: #f7f8fb;
  color: var(--color-text-muted);
}

/* ── Job Edit Body (two columns) ─────────────────────────────── */
.job-edit__body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
  margin-bottom: 20px;
}

.job-edit__main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.editor-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.editor-block h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  font-weight: 700;
  padding: 14px 18px 0;
}

.editor-toolbar {
  display: flex;
  gap: 2px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--color-border);
  margin-top: 10px;
}

.editor-toolbar button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-toolbar button:hover {
  background: #eef1f8;
  color: var(--color-text);
}

.editor-content {
  padding: 14px 18px 18px;
  font-size: 0.9375rem;
  line-height: 1.7;
  min-height: 80px;
  outline: none;
}

.editor-content:focus {
  background: #fbfcfe;
}

.editor-content ul {
  list-style: disc;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-content li {
  font-size: 0.9375rem;
  line-height: 1.6;
}

.job-contact-block h3 {
  padding: 14px 18px 0;
}

.job-contact-block .job-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 18px 18px;
  font-size: 0.9375rem;
}

.job-contact-block .job-contact a {
  color: var(--color-link);
}

.job-contact-block .job-contact a:hover { text-decoration: underline; }

/* ── Meta-Informationen Panel ─────────────────────────────────── */
.job-edit__meta {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.job-edit__meta h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  font-weight: 700;
}

.meta-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.meta-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-field input,
.meta-field select {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
  width: 100%;
}

.meta-field input:focus,
.meta-field select:focus {
  outline: 2px solid #b8d42a;
  outline-offset: 1px;
  border-color: transparent;
}

/* ── Action bar ──────────────────────────────────────────────── */
.job-edit__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  gap: 12px;
  flex-wrap: wrap;
}

.job-edit__actions-left,
.job-edit__actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.job-edit__saved-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-right: 4px;
}

/* ── HiCandidate™ Custom Fields ──────────────────────────────── */
.hicandidate-fields {
  background: var(--color-accent-bg);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 28px 36px;
  margin-bottom: 28px;
}

.hicandidate-fields__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 22px;
}

.hicandidate-fields__badge {
  display: inline-block;
  background: var(--color-accent);
  color: #1a1a2e;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 8px;
  border-radius: 4px;
}

.hicandidate-fields__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
}

.hicandidate-fields__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hicandidate-fields label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.hicandidate-fields select,
.hicandidate-fields input[type="date"] {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  max-width: 300px;
}

.hicandidate-fields select:focus,
.hicandidate-fields input[type="date"]:focus {
  outline: 2px solid #b8d42a;
  outline-offset: 1px;
  border-color: transparent;
}

/* ── Toasts ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.toast {
  background: #1a1a2e;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 320px;
}

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

.toast--success { background: #166534; }
.toast--info { background: #1a1a2e; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .job-edit__body {
    grid-template-columns: 1fr;
  }

  .job-edit__meta {
    position: static;
  }
}

@media (max-width: 860px) {
  .app-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .site-header { padding: 0 16px; gap: 12px; }

  .company-logo { height: 40px; max-width: 180px; }

  .app-user-badge__name { display: none; }

  .job-list-page,
  .job-detail-page {
    margin: 16px auto;
    padding: 0 12px;
  }

  .job-list-header,
  .job-row {
    grid-template-columns: 2fr 1fr;
    gap: 8px;
    padding: 12px 14px;
  }

  .col-type,
  .col-date,
  .col-status,
  .job-type,
  .job-date {
    display: none;
  }

  .job-edit__meta {
    padding: 16px;
  }

  .job-edit__title { font-size: 1.35rem; }

  .hicandidate-fields {
    padding: 20px;
  }

  .hicandidate-fields__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hicandidate-fields select,
  .hicandidate-fields input[type="date"] {
    max-width: 100%;
  }

  .job-edit__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .job-edit__actions-left,
  .job-edit__actions-right {
    justify-content: space-between;
  }
}
