:root {
  --accent: #d45d00;
  --accent-dark: #a94300;
  --ink: #1f2933;
  --muted: #66737f;
  --surface: #ffffff;
  --background: #f4f6f8;
  --border: #dce2e7;
  --danger: #a92d2d;
  --success: #247044;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--background); padding-bottom: 5.5rem; }
a { color: inherit; }
.app-header { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; min-height: 4.25rem; padding: .65rem max(1rem, env(safe-area-inset-left)); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font-size: 1.15rem; font-weight: 800; text-decoration: none; }
.link-button { appearance: none; border: 0; background: transparent; color: var(--accent-dark); padding: .75rem; font: inherit; font-weight: 700; }
.page-shell { width: min(100%, 52rem); margin: 0 auto; padding: 1.15rem 1rem 2rem; }
.bottom-nav { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; padding: .45rem max(.5rem, env(safe-area-inset-right)) max(.45rem, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 18px rgba(0,0,0,.06); }
.bottom-nav a { display: flex; min-width: 0; flex: 1 1 0; flex-direction: column; align-items: center; gap: .1rem; padding: .25rem; color: #48545e; font-size: .72rem; font-weight: 700; text-decoration: none; }
.bottom-nav span { color: var(--accent); font-size: 1.4rem; line-height: 1; }
h1 { margin: .2rem 0 .7rem; font-size: clamp(1.65rem, 7vw, 2.35rem); line-height: 1.1; }
h2 { margin: .4rem 0 .65rem; font-size: 1.15rem; }
p { line-height: 1.48; }
.eyebrow { color: var(--accent-dark); font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.muted, .field-help { color: var(--muted); }
.field-help { margin: 0; font-size: .86rem; }
.hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-heading { margin-bottom: 1.15rem; }
.card, .detail-card, .incident-card, .action-card, .auth-card, .timeline-card, .empty-state { border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); box-shadow: 0 5px 20px rgba(31,41,51,.05); }
.card, .detail-card, .auth-card, .empty-state { padding: 1.15rem; }
.auth-card { max-width: 28rem; margin: 7vh auto 0; padding: 1.5rem; }
.action-grid, .card-list { display: grid; gap: .85rem; }
.action-grid { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-bottom: 1.5rem; }
.action-card { position: relative; display: flex; min-height: 8.5rem; flex-direction: column; justify-content: flex-end; padding: 1rem; text-decoration: none; }
.action-card.accent { color: white; border-color: var(--accent); background: linear-gradient(145deg, #e86b08, #b94c00); }
.action-card small { margin-top: .3rem; opacity: .8; }
.action-icon, .metric { margin-bottom: auto; font-size: 2.1rem; font-weight: 850; }
.incident-card { display: block; padding: 1rem; text-decoration: none; }
.incident-card p { margin: .4rem 0; }
.row { display: flex; align-items: center; gap: .6rem; }
.between { justify-content: space-between; }
.stacked-form { display: grid; gap: .65rem; }
.filter-form { display: grid; gap: .85rem; margin-bottom: 1rem; }
.filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.filter-grid > div { min-width: 0; }
.filter-grid label { display: block; margin-bottom: .25rem; font-size: .8rem; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 1rem 0; }
.pagination { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 1rem; }
label { margin-top: .35rem; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 3rem; border: 1px solid #abb6bf; border-radius: .65rem; background: #fff; padding: .75rem; color: var(--ink); font: inherit; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(212,93,0,.2); border-color: var(--accent); }
.button { display: inline-flex; min-height: 3rem; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: .7rem; padding: .65rem 1rem; font: inherit; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; }
.button.primary { color: #fff; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { color: var(--accent-dark); border-color: #d8a37c; background: #fff8f1; }
.button.danger { color: #fff; background: var(--danger); }
.button.full { width: 100%; margin-top: .5rem; }
.button-row { display: flex; justify-content: flex-end; gap: .55rem; margin-top: .85rem; }
.status, .urgency { display: inline-flex; border-radius: 999px; padding: .28rem .58rem; background: #edf0f2; font-size: .75rem; font-weight: 800; }
.status.closed { color: var(--success); background: #e3f4e9; }
.status.waiting_third_party { color: #7a4b00; background: #fff0c7; }
.status.assigned, .status.in_progress { color: #19578b; background: #e2f1fc; }
.urgency-5 { color: #8c1717; background: #fbe2e2; }
.urgency-4 { color: #934200; background: #ffebd8; }
.details { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.details div { border-top: 1px solid var(--border); padding-top: .6rem; }
.details dt { color: var(--muted); font-size: .77rem; }
.details dd { margin: .2rem 0 0; font-weight: 700; }
.address { font-size: 1.08rem; font-weight: 700; }
.incident-photo { display: block; width: 100%; max-height: 28rem; margin: 1rem 0; border-radius: .8rem; object-fit: cover; }
.text-link { display: block; margin-top: 1rem; color: var(--accent-dark); font-weight: 750; text-align: center; }
.material-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6rem, .45fr) minmax(6rem, .6fr); gap: .55rem; border-top: 1px solid var(--border); padding: .75rem 0; }
.material-field { min-width: 0; }
.material-field label { display: block; margin: 0 0 .25rem; font-size: .72rem; }
.warning-box { border-left: 4px solid #d99800; border-radius: .4rem; background: #fff5d8; padding: .75rem; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; }
.timeline li { position: relative; border-left: 2px solid #d5dce1; padding: 0 0 1rem 1.25rem; }
.timeline-dot { position: absolute; top: .9rem; left: -.42rem; width: .75rem; height: .75rem; border: 2px solid white; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.timeline-card { padding: .85rem; }
.timeline-card p { margin: .35rem 0; }
.message { margin-bottom: .8rem; border-radius: .7rem; padding: .8rem 1rem; background: #e4edf4; }
.message.success { color: #14532d; background: #dcfce7; }
.message.error { color: #7f1d1d; background: #fee2e2; }
.errorlist { margin: 0; padding-left: 1.2rem; color: #9a2020; font-size: .85rem; }
.empty-state { padding: 2rem 1.2rem; text-align: center; }
.offline-banner { position: sticky; top: 0; z-index: 50; padding: .35rem; color: #fff; background: #752424; text-align: center; font-size: .8rem; }
.clamp { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
@media (max-width: 420px) {
  .filter-grid { grid-template-columns: 1fr; }
  .results-toolbar { align-items: stretch; flex-direction: column; }
  .material-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .material-field-description { grid-column: 1 / -1; }
  .details { grid-template-columns: 1fr; }
}
@media (min-width: 760px) {
  body { padding-bottom: 1rem; }
  .bottom-nav { position: static; justify-content: center; gap: 2rem; box-shadow: none; }
  .bottom-nav a { min-width: 4.4rem; flex: 0 0 auto; flex-direction: row; font-size: .9rem; }
  .bottom-nav span { font-size: 1.1rem; }
}
