:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #607080;
  --line: #d9e2ea;
  --panel: #ffffff;
  --page: #eef4f7;
  --brand: #171717;
  --brand-2: #257fa8;
  --accent: #d7a24b;
  --ok: #2f8f5b;
  --warn: #b56b18;
  --shadow: 0 18px 48px rgba(18, 60, 105, 0.16);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(22, 138, 173, 0.18), transparent 34rem),
    linear-gradient(160deg, #f8fbfc 0%, var(--page) 64%, #e7eef2 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: 112px 1fr 44px;
  gap: 14px;
  align-items: center;
  padding: 18px clamp(16px, 4vw, 28px) 12px;
}

.brand-logo {
  display: block;
  width: 112px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: #171717;
  padding: 6px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand-2);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.45rem, 5vw, 2.05rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 0;
  font-size: 1.02rem;
}

.icon-button,
.secondary-action,
.primary-action {
  border: 0;
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 1.4rem;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 clamp(16px, 4vw, 28px) 14px;
}

.tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

main {
  padding: 0 clamp(16px, 4vw, 28px) 28px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.intro-panel,
.dashboard-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74)),
    url("data:image/svg+xml,%3Csvg width='220' height='160' viewBox='0 0 220 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23168aad' stroke-opacity='.18' stroke-width='10'%3E%3Cpath d='M30 50h110a30 30 0 0 1 0 60H92'/%3E%3Cpath d='M70 30h80a48 48 0 1 1 0 96H44'/%3E%3Cpath d='M16 80h72'/%3E%3C/g%3E%3C/svg%3E");
  background-position: right bottom;
  background-repeat: no-repeat;
}

.intro-panel p {
  max-width: 46ch;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.status-tile {
  display: grid;
  place-items: center;
  width: 96px;
  min-height: 96px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  text-align: center;
}

.status-tile strong {
  font-size: 1.65rem;
}

.status-tile span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
}

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.form-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.section-title {
  display: flex;
  gap: 10px;
  align-items: center;
}

.section-title span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #dff2f7;
  color: var(--brand);
  font-weight: 900;
}

label,
fieldset {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  color: #273849;
  font-weight: 800;
}

fieldset {
  border: 0;
  padding: 0;
}

legend {
  padding: 0 0 7px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd7e1;
  border-radius: 8px;
  background: #fbfdfe;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

.checkbox-row {
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(244, 185, 66, 0.55);
  outline-offset: 2px;
}

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

.permission-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid #cbd7e1;
  border-radius: 8px;
  background: #fbfdfe;
  color: var(--muted);
  text-align: center;
}

.segmented input {
  width: 16px;
  min-height: 16px;
}

.helper,
.upload-zone small {
  color: var(--muted);
  font-weight: 500;
}

.upload-zone {
  align-items: center;
  justify-items: center;
  min-height: 132px;
  border: 2px dashed #a9bfcc;
  border-radius: 8px;
  background: #f6fafc;
  text-align: center;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-zone span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--brand-2);
  color: #fff;
  font-size: 1.6rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.primary-action,
.secondary-action {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
}

.primary-action {
  background: var(--brand);
  color: #fff;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand);
}

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

.metrics div,
.job-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metrics div {
  display: grid;
  gap: 2px;
  padding: 14px;
}

.metrics strong {
  color: var(--brand);
  font-size: 1.5rem;
}

.metrics span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.jobs-list {
  display: grid;
  gap: 12px;
}

.job-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.job-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.job-card h3 {
  margin-bottom: 3px;
}

.job-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.badge {
  align-self: start;
  border-radius: 8px;
  padding: 6px 9px;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge.good {
  background: var(--ok);
}

.badge.call {
  background: var(--warn);
}

.badge.decline {
  background: #9b3333;
}

.job-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.job-meta span {
  border-radius: 8px;
  background: #f2f7fa;
  padding: 9px;
  color: #33485c;
  font-size: 0.86rem;
  font-weight: 750;
}

.empty {
  padding: 24px;
  border: 1px dashed #a9bfcc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  text-align: center;
}

dialog {
  width: min(92vw, 390px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(12, 24, 36, 0.52);
}

.dialog-card {
  padding: 22px;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 520px) {
  .app-shell {
    box-shadow: none;
  }

  .intro-panel,
  .dashboard-head {
    grid-template-columns: 1fr;
  }

  .status-tile {
    width: 100%;
    min-height: 72px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .permission-options {
    grid-template-columns: 1fr;
  }

  .job-card header,
  .job-meta {
    grid-template-columns: 1fr;
  }
}
