:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #eef2f8;
  --border: #d8e0ec;
  --text: #132033;
  --muted: #60708a;
  --primary: #1247b8;
  --primary-dark: #0d388f;
  --success: #16794a;
  --danger: #c63838;
  --warning: #996d00;
  --shadow: 0 20px 45px rgba(10, 22, 40, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fafe 0%, #eef3f8 100%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(248, 250, 254, 0.86);
  border-bottom: 1px solid rgba(216, 224, 236, 0.65);
}
.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}
.brand-logo-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brand-logos-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.brand-logo {
  max-height: 68px;
  width: auto;
  object-fit: contain;
}
.brand-logo.secondary {
  max-height: 54px;
  opacity: 1;
}
.brand-name {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.08rem;
}
.brand-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.hero { padding: 72px 0 36px; }
.hero-dark {
  background:
    radial-gradient(circle at top right, rgba(122, 167, 255, 0.22), transparent 28%),
    linear-gradient(135deg, #0d1730 0%, #13284e 55%, #183b74 100%);
  color: #fff;
}
.hero-grid { display: grid; grid-template-columns: 1.25fr 0.85fr; gap: 32px; align-items: center; }
.hero h1, .section-heading h2, .dashboard-top h1, #loginPanel h1 {
  margin: 10px 0 14px; line-height: 1.03; letter-spacing: -0.04em;
}
.hero h1 { font-size: clamp(2.3rem, 5vw, 4.25rem); }
.section-heading h2, .dashboard-top h1, #loginPanel h1 { font-size: clamp(1.9rem, 3vw, 2.8rem); }

.eyebrow {
  display: inline-flex; padding: 8px 12px; border-radius: 999px;
  background: rgba(18, 71, 184, 0.12); color: var(--primary); font-weight: 700;
  font-size: 0.84rem; letter-spacing: 0.02em;
}
.hero-dark .eyebrow { background: rgba(255,255,255,0.12); color: #d8e6ff; }

.hero-copy, .section-heading p, .hero-card, .form-status, small, .site-footer, .muted-text { color: var(--muted); }
.hero-dark .hero-copy, .hero-dark .hero-card, .hero-dark .muted-text, .hero-dark .brand-subtitle { color: rgba(255,255,255,0.78); }

.hero-card, .panel, .vacancy-card, .application-form, .stats-card, .feature-card, .contact-card {
  background: var(--surface);
  border: 1px solid rgba(216, 224, 236, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.hero-card { padding: 26px; }
.hero-card-dark { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); box-shadow: none; }
.hero-media-card { min-height: 320px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-image { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.hero-media-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; color: rgba(255,255,255,0.78); min-height: 220px;
}
.hero-actions, .dashboard-actions, .footer-row { display: flex; flex-wrap: wrap; gap: 12px; }
.header-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 14px;
  flex: 0 0 auto;
}
.header-main-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-btn, .secondary-btn, .ghost-btn {
  min-height: 46px; border-radius: 14px; padding: 0 18px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.primary-btn { background: var(--primary); color: #fff; }
.primary-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.secondary-btn, .ghost-btn { background: rgba(255,255,255,0.82); border-color: var(--border); color: var(--text); }
.secondary-btn:hover, .ghost-btn:hover { transform: translateY(-1px); background: #fff; }
.hero-dark .secondary-btn, .hero-dark .ghost-btn {
  background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.18);
}
.admin-link {
  align-self: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.8;
  transition: opacity 0.16s ease, color 0.16s ease;
}
.admin-link:hover {
  opacity: 1;
  color: var(--text);
}
.danger-btn { color: var(--danger); border-color: rgba(198,56,56,0.2); }

.section { padding: 32px 0 38px; }
.alt-bg { background: rgba(255,255,255,0.35); }
.section-heading { margin-bottom: 24px; }
.section-heading.compact { margin-bottom: 20px; }
.section-spacing { margin-top: 24px; }

.vacancies-grid, .feature-grid, .stats-grid, .contact-grid, .asset-grid {
  display: grid; gap: 20px;
}
.vacancies-grid, .feature-grid { grid-template-columns: repeat(3, 1fr); }
.stats-grid { grid-template-columns: repeat(5, 1fr); margin-bottom: 18px; }
.contact-grid { grid-template-columns: repeat(3, 1fr); }
.asset-grid { grid-template-columns: repeat(3, 1fr); }

.vacancy-card, .feature-card, .contact-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.vacancy-card h3, .feature-card h3 { margin: 0; font-size: 1.12rem; letter-spacing: -0.02em; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; padding: 7px 11px; border-radius: 999px;
  background: rgba(18, 71, 184, 0.08); color: var(--primary); font-size: 0.82rem; font-weight: 700;
}
.empty-panel { padding: 26px; text-align: center; }

.form-layout { max-width: 920px; }
.application-form, .panel, .admin-form-panel { padding: 24px; }
.form-grid, .filters-grid, .admin-grid {
  display: grid; gap: 16px;
}
.form-grid, .admin-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.filters-grid { grid-template-columns: repeat(4, 1fr); }
.admin-grid.split-layout { grid-template-columns: 1.05fr 0.95fr; align-items: start; }
.span-2, .wide-filter { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 8px; }
label span { font-weight: 600; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 14px; background: #fff; color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(18, 71, 184, 0.1);
}
.checkbox-row {
  flex-direction: row; align-items: flex-start; gap: 12px; margin: 16px 0 4px;
}
.checkbox-row input { width: 18px; min-height: 18px; margin-top: 2px; }
.padded-top { padding-top: 30px; }
.file-field small { margin-top: -2px; }
.wide-btn { width: 100%; margin-top: 8px; }
.form-status { min-height: 24px; margin: 14px 0 0; }
.form-status.is-success { color: var(--success); }
.form-status.is-error { color: var(--danger); }
.form-status.is-warning { color: var(--warning); }

.dashboard-top {
  display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px;
}
.stats-card {
  padding: 18px; display: flex; flex-direction: column; gap: 8px;
}
.stats-card strong { font-size: 1.8rem; letter-spacing: -0.03em; }

.tabs-bar {
  display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 22px;
}
.tab-btn {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.85); color: var(--text); font-weight: 700;
}
.tab-btn.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.table-scroll { overflow: auto; }
.applications-table {
  width: 100%; border-collapse: collapse; min-width: 1000px;
}
.applications-table th, .applications-table td {
  padding: 14px 12px; border-bottom: 1px solid var(--border);
  vertical-align: top; text-align: left;
}
.applications-table th { font-size: 0.88rem; color: var(--muted); font-weight: 700; }
.cell-stack { display: flex; flex-direction: column; gap: 5px; }
.row-actions { display: grid; gap: 8px; }
.inline-select { min-height: 42px; }
.notes-input { min-height: 140px; resize: vertical; width: 100%; }
.application-summary-row td { background: rgba(255,255,255,0.92); }
.application-editor-row td {
  padding: 0 12px 18px;
  background: rgba(248, 250, 253, 0.95);
  border-bottom: 1px solid var(--border);
}
.application-editor-grid {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(420px, 1fr) minmax(160px, 200px);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}
.application-current-status { display: flex; align-items: flex-start; }
.editor-field { display: grid; gap: 8px; }
.editor-field > label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.notes-field { min-width: 0; }
.stacked-actions { display: grid; gap: 10px; align-content: start; }
.status-pill,
.status-select {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-pill {
  background: #edf2f8;
  color: #1f2937;
}

.status-select {
  min-width: 160px;
  appearance: none;
  cursor: pointer;
}

.status-pill[data-state="Novo"],
.status-select[data-state="Novo"] {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.status-pill[data-state="Em análise"],
.status-select[data-state="Em análise"] {
  background: #f97316;
  color: #ffffff;
  border-color: #f97316;
}

.status-pill[data-state="Entrevista"],
.status-select[data-state="Entrevista"] {
  background: #facc15;
  color: #1f2937;
  border-color: #facc15;
}

.status-pill[data-state="Rejeitado"],
.status-select[data-state="Rejeitado"] {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.status-pill[data-state="Aceite"],
.status-pill[data-state="Admitido"],
.status-select[data-state="Aceite"],
.status-select[data-state="Admitido"] {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

.status-pill-neutral {
  background: #eef2f7;
  color: #334155;
  border: 1px solid #d8e0ea;
}

.status-pill-neutral.is-active {
  background: #ecfdf3;
  color: #166534;
  border-color: #bbf7d0;
}

.status-pill-neutral.is-inactive {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
.empty-state { text-align: center; color: var(--muted); }
.narrow-panel { max-width: 560px; margin: 0 auto; }

.asset-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255,255,255,0.9);
  display: grid;
  gap: 12px;
}
.asset-preview {
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  border: 1px dashed var(--border);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #f7f9fc;
}
.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.asset-placeholder {
  color: var(--muted);
  font-weight: 600;
}
.asset-meta {
  display: grid;
  gap: 4px;
}
.contact-item {
  display: grid;
  gap: 8px;
}
.contact-item a {
  font-weight: 700;
}

.compact-actions { gap: 8px; }
.site-footer { padding: 28px 0 40px; }
.footer-row { justify-content: space-between; }

@media (max-width: 1080px) {
  .application-editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .hero-grid,
  .vacancies-grid,
  .feature-grid,
  .contact-grid,
  .asset-grid,
  .stats-grid,
  .form-grid,
  .filters-grid,
  .admin-grid.two-col,
  .admin-grid.split-layout {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-top { align-items: stretch; flex-direction: column; }
}

@media (max-width: 760px) {
  .topbar,
  .footer-row,
  .hero-grid,
  .vacancies-grid,
  .feature-grid,
  .contact-grid,
  .asset-grid,
  .stats-grid,
  .form-grid,
  .filters-grid,
  .admin-grid.two-col,
  .admin-grid.split-layout {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
  .header-actions,
  .hero-actions,
  .dashboard-actions,
  .compact-actions { width: 100%; }
  .header-actions {
    align-items: stretch;
    gap: 10px;
  }
  .header-main-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .header-main-actions > * { width: 100%; }
  .hero-actions > *,
  .dashboard-actions > *,
  .compact-actions > * { width: 100%; }
  .admin-link {
    align-self: flex-start;
    width: auto;
  }
  .site-header { position: static; }
}
