:root {
  --orange: #f25a00;
  --orange-dark: #cc4800;
  --black: #080909;
  --charcoal: #1d1e1f;
  --panel: #ffffff;
  --soft: #f4f1ef;
  --line: #d9d1cc;
  --muted: #68645f;
  --success: #1f7a4c;
  --warning: #a55300;
  --danger: #a32626;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171717;
  background: radial-gradient(circle at top left, #292929 0, var(--black) 55%, #000 100%);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1280px; margin: 0 auto; min-height: 100vh; background: var(--panel); }
.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 22px; color: #fff; background: var(--charcoal); border-top: 7px solid var(--orange);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; background: var(--orange); font-weight: 900; }
.brand h1 { margin: 0; font-size: 20px; }
.brand small { color: #cfc8c3; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nav {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px;
  background: #111; border-bottom: 1px solid #333;
}
.nav button {
  min-width: max-content; padding: 11px 16px; border: 1px solid #444; border-radius: 6px;
  background: #222; color: #eee; font-weight: 700;
}
.nav button.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.main { padding: 22px; }
.panel { display: none; }
.panel.active { display: block; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.panel-header h2 { margin: 0 0 5px; }
.panel-header p { margin: 0; color: var(--muted); }
.register-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.card { padding: 18px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.06); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.wide { grid-column: 1 / -1; }
label { display: block; font-weight: 700; color: var(--charcoal); }
input, select, textarea {
  width: 100%; margin-top: 6px; padding: 11px; color: #111; background: #fff;
  border: 1px solid var(--line); border-radius: 5px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(242,90,0,.24); border-color: var(--orange); }
.primary, .secondary, .danger {
  border: 0; border-radius: 6px; padding: 11px 16px; color: #fff; font-weight: 800;
}
.primary { background: var(--orange); }
.primary:hover { background: var(--orange-dark); }
.secondary { background: var(--charcoal); }
.danger { background: var(--danger); }
.button-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.status-strip {
  display: flex; gap: 12px; align-items: center; padding: 10px 18px;
  background: #fff4ed; border-bottom: 1px solid #f2c5a6; color: #6c2a00; font-size: 13px;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warning); }
.status-dot.online { background: var(--success); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { padding: 16px; color: #fff; background: var(--charcoal); border-left: 5px solid var(--orange); border-radius: 7px; }
.metric strong { display: block; font-size: 28px; }
.metric span { color: #ded8d4; font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--charcoal); color: #fff; font-size: 12px; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.select-column { width: 44px; text-align: center; }
.select-column input, td.row-select input { width: 20px; height: 20px; margin: 0; accent-color: var(--orange); }
td.row-select { text-align: center; }
tr.is-selected td { background: #fff4ed; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.badge.open { color: #7a2800; background: #ffe0cc; }
.badge.in_progress { color: #725300; background: #fff0b8; }
.badge.resolved { color: #155b38; background: #d7f0e3; }
.badge.closed { color: #fff; background: #555; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 10px; margin-top: 12px; }
.photo-grid figure { margin: 0; padding: 7px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; }
.photo-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: 4px; }
.photo-grid figcaption { margin-top: 5px; color: var(--muted); font-size: 11px; }
.photo-grid .photo-link { display: block; color: inherit; text-decoration: none; }
.photo-grid .closeout-photo { border: 2px solid var(--success); }
.comment-list { margin-top: 16px; }
.comment { padding: 12px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.comment p { margin: 5px 0; white-space: pre-wrap; }
.comment small { color: var(--muted); }
.report-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.qr-card { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center; }
.qr-box { min-height: 170px; display: grid; place-items: center; background: #fff; border: 2px dashed var(--orange); }
.muted { color: var(--muted); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.location-map {
  min-height: 420px; position: relative; overflow: hidden; background: #f3f0ed;
  border: 2px dashed #bdb4ae; border-radius: 8px;
}
.location-map img { width: 100%; display: block; }
.location-pin {
  position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px;
  border: 3px solid #fff; border-radius: 50%; color: #fff; background: var(--orange);
  box-shadow: 0 3px 12px rgba(0,0,0,.4); font-weight: 900;
}
.login-cover { padding: 70px 22px; text-align: center; }
.login-cover .card { max-width: 520px; margin: 0 auto; }
@media (max-width: 700px) {
  .app-header { align-items: flex-start; flex-direction: column; }
  .main { padding: 14px; }
  .qr-card { grid-template-columns: 1fr; }
  .panel-header { flex-direction: column; }
  .register-actions { width: 100%; }
  .register-actions button { flex: 1 1 140px; }
}
