:root {
  --ink: #171513;
  --muted: #77716b;
  --paper: #f7f5f1;
  --panel: #ffffff;
  --line: #e9e4dd;
  --brand: #b98e62;
  --brand-strong: #9f7449;
  --brand-soft: #f3e9dd;
  --success: #18794e;
  --success-soft: #e9f7f0;
  --warning: #a56700;
  --warning-soft: #fff4da;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 18px 50px rgba(43, 34, 26, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--brand) 11%, transparent), transparent 30rem),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.app-shell { min-height: 100vh; }

/* Public report flow */
.report-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(32px, env(safe-area-inset-bottom));
}
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--ink); color: var(--brand);
  box-shadow: 0 8px 22px rgba(23,21,19,.12);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-weight: 760; letter-spacing: -0.02em; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.powered { color: var(--muted); font-size: 12px; }
.admin-link {
  border: 1px solid var(--line); background: rgba(255,255,255,.72); border-radius: 999px; padding: 9px 12px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.report-card {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.location-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; padding: 7px 10px; margin-bottom: 18px;
  color: var(--brand-strong); background: var(--brand-soft); font-size: 12px; font-weight: 760;
}
.eyebrow { color: var(--brand-strong); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
h1, h2, h3, p { margin-top: 0; }
.report-card h1 { font-size: clamp(28px, 8vw, 38px); letter-spacing: -0.045em; line-height: 1.02; margin: 7px 0 11px; }
.intro { color: var(--muted); font-size: 15px; line-height: 1.55; margin-bottom: 25px; }
.section-label { display: block; font-size: 13px; font-weight: 780; margin: 0 0 10px; }
.issue-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 23px; }
.issue-btn {
  min-height: 76px; border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 13px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px;
  text-align: left; cursor: pointer; transition: .18s ease;
}
.issue-btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.issue-btn.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.issue-icon { width: 29px; height: 29px; border-radius: 10px; display: grid; place-items: center; background: #f4f1ed; }
.issue-btn.selected .issue-icon { background: #fff; }
.issue-name { font-size: 13px; font-weight: 750; line-height: 1.2; }
.field { margin-bottom: 18px; }
.field textarea, .field input, .field select {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm);
  padding: 14px 15px; color: var(--ink); outline: none; transition: .18s ease;
}
.field textarea { min-height: 108px; resize: vertical; line-height: 1.45; }
.field textarea:focus, .field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.field-help { color: var(--muted); font-size: 11px; margin-top: 7px; }
.upload {
  display: flex; align-items: center; gap: 12px; border: 1px dashed #d8d0c7; border-radius: var(--radius-sm);
  padding: 13px 14px; background: #fcfbf9; cursor: pointer;
}
.upload input { display: none; }
.upload-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; flex: 0 0 auto; }
.upload-title { font-size: 13px; font-weight: 760; margin-bottom: 2px; }
.upload-subtitle { font-size: 11px; color: var(--muted); }
.primary-btn, .secondary-btn, .ghost-btn, .danger-btn {
  border: 0; border-radius: 16px; min-height: 50px; padding: 0 17px; font-weight: 780; cursor: pointer; transition: .18s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
}
.primary-btn { width: 100%; background: var(--ink); color: #fff; box-shadow: 0 12px 24px rgba(23,21,19,.15); }
.primary-btn:hover { transform: translateY(-1px); }
.primary-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.secondary-btn { background: var(--brand-soft); color: var(--ink); }
.ghost-btn { background: #fff; border: 1px solid var(--line); }
.danger-btn { background: var(--danger-soft); color: var(--danger); }
.privacy-note { color: var(--muted); font-size: 11px; line-height: 1.45; text-align: center; margin: 15px 10px 0; }
.success-state { text-align: center; padding: 20px 2px 5px; }
.success-badge { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); margin: 0 auto 18px; }
.success-state h2 { font-size: 27px; letter-spacing: -.035em; margin-bottom: 8px; }
.ticket { display: inline-flex; gap: 8px; align-items: center; background: #f5f2ee; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 720; margin: 12px 0 22px; }

/* Admin */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 242px minmax(0, 1fr); background: #f4f2ee; }
.sidebar { background: var(--ink); color: #f5f1eb; padding: 23px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand-lockup { padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.09); }
.sidebar .brand-mark { background: #28241f; }
.sidebar .brand-name { color: #fff; }
.nav { display: grid; gap: 7px; margin-top: 22px; }
.nav-btn { border: 0; background: transparent; color: #bfb8af; border-radius: 13px; padding: 11px 12px; display: flex; align-items: center; gap: 11px; cursor: pointer; text-align: left; font-weight: 650; }
.nav-btn:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-btn.active { background: rgba(199,164,127,.15); color: #f3d6b7; }
.nav-btn svg { width: 18px; height: 18px; }
.sidebar-bottom { margin-top: auto; padding: 14px 8px 0; }
.demo-account { padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 15px; font-size: 12px; color: #bbb3aa; line-height: 1.45; }
.back-link { color: #fff; display: inline-flex; margin-top: 11px; font-size: 12px; font-weight: 700; text-decoration: none; }
.admin-main { min-width: 0; padding: 26px clamp(18px, 4vw, 44px) 50px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.admin-top h1 { font-size: clamp(25px, 4vw, 34px); letter-spacing: -.04em; margin-bottom: 5px; }
.admin-sub { color: var(--muted); font-size: 13px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; font-weight: 800; color: var(--brand-strong); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 20px; }
.stat-card, .panel { background: #fff; border: 1px solid #ebe6df; border-radius: 20px; box-shadow: 0 8px 24px rgba(61,49,37,.035); }
.stat-card { padding: 18px; }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 690; margin-bottom: 10px; }
.stat-value { font-size: 28px; font-weight: 820; letter-spacing: -.04em; }
.stat-delta { font-size: 10px; color: var(--success); margin-top: 7px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); gap: 18px; }
.panel { overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 14px; font-weight: 800; }
.panel-body { padding: 18px; }
.report-list { display: grid; }
.report-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(140px, .8fr) 105px 112px; gap: 13px; align-items: center; padding: 15px 18px; border-bottom: 1px solid #f0ece7; }
.report-row:last-child { border-bottom: 0; }
.report-title { font-size: 13px; font-weight: 770; margin-bottom: 4px; }
.report-meta { color: var(--muted); font-size: 11px; line-height: 1.35; }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 7px 9px; font-size: 10px; font-weight: 800; width: fit-content; }
.badge.new { color: #245db2; background: #edf4ff; }
.badge.progress { color: var(--warning); background: var(--warning-soft); }
.badge.resolved { color: var(--success); background: var(--success-soft); }
.status-select { border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 11px; padding: 8px 9px; width: 100%; }
.quick-actions { display: grid; gap: 10px; }
.quick-card { border: 1px solid var(--line); border-radius: 15px; padding: 13px; background: #fff; display: flex; align-items: center; gap: 11px; cursor: pointer; }
.quick-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); }
.quick-title { font-size: 12px; font-weight: 780; }
.quick-sub { font-size: 10px; color: var(--muted); margin-top: 3px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; }
.asset-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.asset-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.asset-table td { padding: 14px 16px; border-bottom: 1px solid #f0ece7; font-size: 12px; vertical-align: middle; }
.asset-table tr:last-child td { border-bottom: 0; }
.asset-name { font-weight: 760; }
.muted { color: var(--muted); }
.small-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px; font-size: 11px; font-weight: 720; cursor: pointer; }

.settings-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(300px,.95fr); gap: 18px; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.form-card h2 { font-size: 17px; letter-spacing: -.025em; margin-bottom: 5px; }
.form-card > p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 20px; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] { width: 50px; height: 44px; padding: 4px; border-radius: 12px; }
.preview-wrap { background: linear-gradient(145deg,#ece8e2,#f8f7f4); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: grid; place-items: center; min-height: 540px; }
.phone { width: min(100%, 310px); height: 560px; background: var(--paper); border-radius: 35px; border: 8px solid #1f1d1a; box-shadow: 0 20px 44px rgba(23,21,19,.18); padding: 22px 14px; overflow: hidden; }
.phone .report-card { border-radius: 22px; padding: 17px 15px; box-shadow: 0 10px 28px rgba(43,34,26,.07); }
.phone .report-card h1 { font-size: 24px; }
.phone .intro { font-size: 11px; margin-bottom: 14px; }
.phone .issue-grid { gap: 7px; margin-bottom: 12px; }
.phone .issue-btn { min-height: 58px; border-radius: 13px; padding: 9px; }
.phone .issue-icon { width: 22px; height: 22px; border-radius: 7px; }
.phone .issue-name { font-size: 10px; }
.phone .brand-row { margin-bottom: 17px; }
.phone .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
.phone .brand-name { font-size: 12px; }
.phone .powered { font-size: 9px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 15px; font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .24s ease; box-shadow: 0 14px 30px rgba(0,0,0,.16); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-admin-bar { display: none; }

@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2,1fr); }
  .grid-2, .settings-grid { grid-template-columns: 1fr; }
  .report-row { grid-template-columns: minmax(170px,1.3fr) 120px 100px; }
  .report-row .report-location { display: none; }
}
@media (max-width: 760px) {
  .admin-shell { display: block; }
  .sidebar { display: none; }
  .admin-main { padding: 18px 14px 92px; }
  .admin-top { margin-bottom: 18px; }
  .mobile-admin-bar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 50; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); background: rgba(23,21,19,.96); border-radius: 18px; padding: 7px; box-shadow: 0 12px 34px rgba(0,0,0,.22); backdrop-filter: blur(16px); }
  .mobile-admin-bar .nav-btn { padding: 9px 6px; flex-direction: column; gap: 4px; justify-content: center; font-size: 9px; border-radius: 12px; }
  .mobile-admin-bar .nav-btn svg { width: 17px; height: 17px; }
  .report-row { grid-template-columns: minmax(0,1fr) 94px; gap: 8px; padding: 13px 14px; }
  .report-row .report-location, .report-row .report-time { display: none; }
  .panel-head { padding: 15px; }
  .stats { gap: 9px; }
  .stat-card { padding: 14px; border-radius: 16px; }
  .stat-value { font-size: 23px; }
  .preview-wrap { min-height: unset; }
}
@media (max-width: 420px) {
  .report-shell { padding-left: 13px; padding-right: 13px; }
  .report-card { padding: 23px 17px; }
  .issue-grid { gap: 8px; }
  .issue-btn { min-height: 72px; padding: 11px; }
  .admin-link { padding: 8px 9px; }
  .powered { display: none; }
}
