:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f4;
  --text: #172026;
  --muted: #65727d;
  --line: #d9e0e5;
  --primary: #007b83;
  --primary-dark: #005e64;
  --green: #238447;
  --red: #c93b3b;
  --amber: #a86c00;
  --blue: #2b62b9;
  --job: #d94135;
  --internship: #b1367d;
  --freelance: #7d4a20;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar-actions,
.inline-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.breadcrumb {
  margin-bottom: 12px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 82px;
}

.metric span,
.detail-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 24px 0 10px;
}

.section-header h2 {
  margin: 0;
  font-size: 20px;
}

.section-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.btn-sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-primary,
.btn-success {
  background: var(--primary);
}

.btn-primary:hover,
.btn-success:hover {
  background: var(--primary-dark);
}

.btn-danger {
  background: var(--red);
}

.btn-danger:hover {
  background: #a92d2d;
}

.btn-secondary {
  background: #5f6972;
}

.btn-secondary:hover {
  background: #49525a;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--surface-2);
  color: #33414a;
  font-size: 12px;
  text-transform: uppercase;
}

.table tbody tr.is-clickable {
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.table-hover tbody tr.is-clickable:hover {
  background: #eef8f6;
  box-shadow: inset 3px 0 0 var(--primary);
}

.table tbody tr.is-clickable:focus-visible {
  background: #eef8f6;
  box-shadow: inset 3px 0 0 var(--primary);
  outline: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  color: #0d4f28;
  background: #dff4e7;
}

.badge-muted {
  color: #48525b;
  background: #e7ebee;
}

.badge-warning {
  color: #6d4300;
  background: #fff0cf;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.detail-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-width: 0;
}

.detail-row strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.parameters-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.parameter {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.parameter span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.parameter strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.job-description {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  overflow-wrap: anywhere;
}

.editor-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 22px;
  padding: 16px;
}

.is-hidden {
  display: none !important;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  display: block;
  min-width: 0;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.form-field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.parameters-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.parameters-editor-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.parameters-editor {
  display: grid;
  gap: 8px;
}

.parameter-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
  gap: 8px;
}

.form-field input,
.form-field select,
.form-field textarea,
.parameter-edit-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
}

.form-field input,
.form-field select,
.parameter-edit-row input {
  min-height: 42px;
}

.form-field textarea {
  min-height: 220px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.parameter-edit-row input:focus {
  border-color: var(--primary);
  outline: none;
}

.form-message {
  min-height: 20px;
  margin: 12px 0;
  color: var(--muted);
}

.form-message.is-error {
  color: var(--red);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.load-more-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0 8px;
}

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

.scroll-sentinel {
  height: 1px;
  width: 100%;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-shell {
  width: min(420px, calc(100% - 32px));
  margin: 0 auto;
}

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.auth-panel h1 {
  margin: 4px 0 22px;
  font-size: 28px;
}

.auth-panel label {
  display: block;
  margin-bottom: 14px;
}

.auth-panel label span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.auth-panel input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 15px;
  padding: 0 12px;
}

.auth-panel input:focus {
  border-color: var(--primary);
  outline: none;
}

.auth-error {
  min-height: 20px;
  color: var(--red);
  margin: 0 0 12px;
}

.auth-submit {
  width: 100%;
}

.text-color-primary {
  color: var(--primary);
}

.text-color-draft {
  color: var(--amber);
}

.text-color-danger {
  color: var(--red);
}

.text-color-job,
.text-color-internship,
.text-color-freelance {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.text-color-job {
  background: var(--job);
}

.text-color-internship {
  background: var(--internship);
}

.text-color-freelance {
  background: var(--freelance);
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics-grid,
  .detail-grid,
  .parameters-list,
  .form-grid,
  .parameter-edit-row {
    grid-template-columns: 1fr;
  }
}
