:root {
  --brand: #2563EB;
  --brand-accent: #60A5FA;
  --brand-pale: #E9F1FF;
  --brand-navy: #172033;
  --green: #16a34a; --yellow: #ca8a04; --red: #dc2626; --repair: #7c3aed;
  --ink: #1f2937; --muted: #6b7280; --border: #e5e7eb;
}
* { box-sizing: border-box; }
body { font-family: -apple-system, system-ui, sans-serif; color: var(--ink); margin: 0; background: #f9fafb; }
.site-header { padding: 0.9rem 2rem; background: white; border-bottom: 2px solid var(--brand); display: flex; align-items: center; }
.site-header .brand { display: inline-flex; align-items: center; }
.site-header .brand img { height: 40px; display: block; }
main { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
.landing-logo { max-width: 320px; height: auto; margin-bottom: 1rem; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.btn { background: var(--brand); color: white; padding: 0.5rem 1rem; border-radius: 6px; text-decoration: none; border: none; cursor: pointer; }
.btn-secondary { background: white; color: var(--ink); border: 1px solid var(--border); padding: 0.5rem 1rem; border-radius: 6px; text-decoration: none; margin-right: 0.5rem; cursor: pointer; }
.device-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; margin-bottom: 2rem; }
.device-table th, .device-table td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.status { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.8rem; color: white; text-transform: capitalize; }
.status-operational { background: var(--green); }
.status-maintenance_due { background: var(--yellow); }
.status-out_of_service { background: var(--red); }
.status-under_repair { background: var(--repair); }
.status-open { background: var(--red); }
.status-acknowledged { background: var(--yellow); }
.status-resolved { background: var(--green); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: white; border-radius: 8px; padding: 1rem; text-align: center; border-top: 4px solid var(--border); }
.stat-card.stat-good { border-top-color: var(--green); }
.stat-card.stat-warn { border-top-color: var(--yellow); }
.stat-card.stat-bad { border-top-color: var(--red); }
.stat-card.stat-info { border-top-color: var(--repair); }
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }
.device-detail { display: flex; gap: 2rem; background: white; padding: 1.5rem; border-radius: 8px; }
.device-info dl { display: grid; grid-template-columns: 160px 1fr; row-gap: 0.4rem; }
.device-info dt { color: var(--muted); }
.device-qr { text-align: center; }
.device-qr img { width: 180px; height: 180px; }
.fault-form-section { background: white; padding: 1.5rem; border-radius: 8px; margin-top: 1.5rem; }
.device-form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 400px; }
.device-form input, .device-form select, .device-form textarea { padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; }
.notice { background: #ecfdf5; border: 1px solid #10b981; color: #065f46; padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.notice-error { background: #fef2f2; border-color: #dc2626; color: #991b1b; }
.hint { color: var(--muted); }
.fault-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.fault-meta { font-size: 0.7rem; color: var(--muted); margin-top: 0.25rem; }
.btn-small { padding: 0.3rem 0.6rem; font-size: 0.8rem; border-radius: 6px; border: none; cursor: pointer; background: var(--brand); color: white; }
.resolve-form { display: inline-flex; gap: 0.3rem; align-items: center; }
.resolve-form input { padding: 0.3rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.8rem; width: 150px; }
