* { box-sizing: border-box; }
:root {
  --accent: #ff5a2e;
  --accent-2: #ff2d55;
  --accent-grad: linear-gradient(135deg, #ff9a3c 0%, #ff5a2e 50%, #ff2d55 100%);
  --accent-soft: rgba(255, 90, 46, 0.14);
  --accent-border: rgba(255, 90, 46, 0.4);
  --ink: #f4efe9;
  --muted: #a89fa8;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --glass: rgba(255, 255, 255, 0.032);
  --glass-strong: rgba(255, 255, 255, 0.065);
  --bg-0: #020104;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg-0);
  position: relative;
  overflow-x: hidden;
}
body::before, body::after {
  content: ''; position: fixed; z-index: -1; border-radius: 50%;
  filter: blur(110px); pointer-events: none;
}
body::before {
  width: 620px; height: 620px; top: -220px; left: -160px;
  background: radial-gradient(circle, rgba(255, 110, 16, 0.3), transparent 70%);
}
body::after {
  width: 680px; height: 680px; bottom: -260px; right: -180px;
  background: radial-gradient(circle, rgba(255, 16, 60, 0.27), transparent 70%);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: rgba(5, 4, 7, 0.65);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar__title {
  font-weight: 800; font-size: 17px; letter-spacing: .2px;
  color: var(--accent);
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.topbar__actions { display: flex; gap: 8px; }

.btn {
  border: none; border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--accent {
  background: var(--accent-soft); color: #ffb37f; border: 1px solid var(--accent-border);
}
.btn--accent:hover { background: rgba(255, 90, 46, 0.22); border-color: rgba(255, 90, 46, 0.6); }
.btn--primary {
  background: var(--accent-grad); color: #1a0700; font-weight: 700;
  box-shadow: 0 6px 22px rgba(255, 45, 85, 0.35);
}
.btn--primary:hover { box-shadow: 0 8px 28px rgba(255, 45, 85, 0.5); transform: translateY(-1px); }
.btn--dark { background: rgba(255, 45, 85, 0.12); color: #ff9fb2; border: 1px solid rgba(255, 45, 85, 0.35); }
.btn--dark:hover { background: rgba(255, 45, 85, 0.2); border-color: rgba(255, 45, 85, 0.55); }
.btn--ghost { background: var(--glass); color: var(--ink); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--glass-strong); border-color: var(--border-strong); }
.btn--full { width: 100%; margin-top: 6px; }

.layout {
  display: grid; grid-template-columns: 420px 1fr; gap: 20px;
  padding: 24px 28px; align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.card {
  background: var(--glass); border: 1px solid var(--border); border-radius: 18px; padding: 22px;
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card h2 { margin: 0 0 16px; font-size: 15px; color: var(--ink); }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
label.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
label.checkbox input { width: auto; accent-color: var(--accent); }

textarea, input[type=number], input[type=text], input[type=password] {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  /* 16px avoids iOS/Android auto-zooming the page when a field is focused */
  font-size: 16px; font-family: inherit; resize: vertical;
  background: rgba(255, 255, 255, 0.03); color: var(--ink);
}
textarea::placeholder, input::placeholder { color: #726c78; }
textarea:focus, input[type=number]:focus, input[type=text]:focus, input[type=password]:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

.row { display: flex; gap: 8px; align-items: flex-start; }
.row textarea { flex: 1; }
.row--tight { gap: 12px; }
.row--tight > div { flex: 1; }

.hint { font-size: 11px; color: #857e8a; margin: 6px 0 0; line-height: 1.4; }
.msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.msg.error { color: #ff7a90; }
.msg.ok { color: #4fe3a0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.status { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.status--pending { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.status--running { background: rgba(255, 176, 40, 0.18); color: #ffbf5c; }
.status--done { background: rgba(60, 214, 140, 0.16); color: #5fe3a0; }
.status--error { background: rgba(255, 45, 85, 0.18); color: #ff6f8f; }

.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 12px; padding: 0; }
.link-btn:hover { color: var(--accent-2); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(1, 1, 2, 0.78); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
.modal {
  background: rgba(7, 6, 8, 0.85); border: 1px solid var(--border-strong); border-radius: 18px;
  padding: 20px; width: 360px; max-width: calc(100vw - 32px);
  max-height: 70vh; display: flex; flex-direction: column; gap: 10px;
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 90, 46, 0.08);
}
.modal h3 { margin: 0; font-size: 14px; color: var(--ink); }
.modal .list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.modal label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); margin: 0; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* ---- Standalone login page (login.html links this same stylesheet) ---- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-page .card { width: 340px; max-width: calc(100vw - 32px); padding: 40px 36px; }
.login-page h1 { font-size: 19px; margin: 0 0 24px; color: var(--ink); font-weight: 700; }
.login-page .error { color: #ff7a90; font-size: 13px; margin: -8px 0 16px; }

/* ---- Mobile: everything below is a deliberate re-layout, not a shrunk desktop view ---- */
@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap; padding: 12px 14px; gap: 10px;
  }
  .topbar__title { font-size: 17px; width: 100%; }
  .topbar__actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .topbar__actions .btn, .topbar__actions form { flex: 1 1 auto; }
  .topbar__actions form { display: flex; }
  .btn { white-space: normal; font-size: 14px; padding: 11px 14px; width: 100%; }

  .layout { padding: 14px; gap: 14px; }
  .card { padding: 16px; }
  .card h2 { font-size: 17px; }

  label { font-size: 14px; margin: 16px 0 7px; }
  .hint { font-size: 12.5px; }

  /* City/niche textarea + picker button: stack instead of squeezing side by side */
  .row { flex-direction: column; }
  .row .btn { width: 100%; }
  .row--tight { flex-direction: row; }

  /* Jobs table -> stacked cards. Each <td> becomes a labeled line via data-label. */
  .table-wrap { overflow-x: visible; }
  table, thead, tbody, th, td, tr { display: block; width: 100%; }
  thead { display: none; }
  tbody tr {
    border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
  }
  td {
    border: none; padding: 7px 0; white-space: normal; font-size: 14px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
  }
  td::before {
    content: attr(data-label); color: var(--muted); font-weight: 600; font-size: 12.5px; flex: none;
  }

  .modal { width: 100%; max-width: calc(100vw - 24px); padding: 18px; }
  .modal label { font-size: 14px; }

  body::before, body::after { filter: blur(70px); }
}
