:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1c2733;
  --muted: #6b7885;
  --line: #dce1e6;
  --brand: #14395c;
  --brand-ink: #ffffff;
  --accent: #1f6feb;
  --danger: #b3261e;
  --ok: #1a7f4b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  background: var(--brand);
  color: var(--brand-ink);
  padding: .75rem 1rem;
}
.brand { color: var(--brand-ink); font-weight: 700; letter-spacing: .04em; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav a { color: var(--brand-ink); text-decoration: none; opacity: .9; }
.nav a:hover { opacity: 1; text-decoration: underline; }
.nav .who { color: #cdd9e5; font-size: .9rem; }
.inline { display: inline; margin: 0; }

.container { max-width: 980px; margin: 1.25rem auto; padding: 0 1rem; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
h1 { font-size: 1.4rem; margin: .2rem 0 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.login-card, .form-card { max-width: 460px; margin: 2rem auto; }

label { display: block; margin: .6rem 0; font-weight: 600; font-size: .92rem; }
.input {
  display: block; width: 100%; margin-top: .3rem;
  padding: .55rem .6rem; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink);
}
textarea.input { resize: vertical; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
label.check input { width: auto; margin: 0; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.err { display: block; color: var(--danger); font-size: .82rem; margin-top: .25rem; }
.hidden { display: none; }

.btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  padding: .5rem .85rem; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: .92rem; font-weight: 600;
}
.btn:hover { background: #f0f2f4; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #0f2e49; }
.btn-small { padding: .3rem .6rem; font-size: .82rem; }
.btn-link { background: none; border: none; color: var(--accent); padding: .5rem .4rem; }
.btn-link:hover { text-decoration: underline; background: none; }
.form-actions { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; }

.search { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search .input { max-width: 360px; }

table.jobs { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.jobs th, table.jobs td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
table.jobs th { background: #eef1f4; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
table.jobs tr:last-child td { border-bottom: none; }
.actions { text-align: right; white-space: nowrap; }

.status { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.status-new { background: #e7eef7; color: #14395c; }
.status-scheduled { background: #e3f0ff; color: #1f6feb; }
.status-in-progress { background: #fff2d6; color: #8a5a00; }
.status-waiting { background: #f3e3ff; color: #6b21a8; }
.status-completed { background: #dff3e6; color: #1a7f4b; }

.flash { padding: .6rem .8rem; border-radius: 7px; margin-bottom: .8rem; font-size: .92rem; }
.flash-error { background: #fbe3e1; color: var(--danger); border: 1px solid #f2c2bd; }
.flash-success { background: #e2f4ea; color: var(--ok); border: 1px solid #bfe4cd; }

.empty { color: var(--muted); padding: 1.5rem 0; }

/* Mobile: stack the table into cards. */
@media (max-width: 640px) {
  table.jobs, table.jobs thead, table.jobs tbody, table.jobs th, table.jobs td, table.jobs tr { display: block; }
  table.jobs { border: none; background: none; }
  table.jobs thead { position: absolute; left: -9999px; }
  table.jobs tr { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: .75rem; padding: .5rem .7rem; }
  table.jobs td { border: none; padding: .3rem 0; display: flex; justify-content: space-between; gap: 1rem; }
  table.jobs td::before { content: attr(data-label); font-weight: 700; color: var(--muted); font-size: .78rem; text-transform: uppercase; }
  .actions { justify-content: flex-end; }
  .page-head { flex-direction: column; align-items: stretch; }
}
