* { box-sizing: border-box; }
body { margin:0; font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; background:#f3f4f6; }
.hidden { display:none !important; }

/* Login */
.login-screen {
  height:100vh; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg,#1e3a8a,#111827);
}
.login-box {
  background:#fff; padding:32px; border-radius:16px; width:320px; text-align:center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.login-box h1 { font-size:20px; margin-bottom:4px; }
.login-box .sub { color:#6b7280; font-size:13px; margin-bottom:16px; }
.login-box input { width:100%; padding:10px; margin-bottom:10px; border:1px solid #d1d5db; border-radius:8px; }
.login-box button { width:100%; padding:10px; background:#2563eb; color:#fff; border:none; border-radius:8px; font-weight:600; cursor:pointer; }
.login-box .error { color:#dc2626; font-size:13px; margin-top:8px; min-height:16px; }
.login-box .hint { color:#9ca3af; font-size:11px; margin-top:10px; }

/* App layout */
.app { height:100vh; display:flex; flex-direction:column; }
.topbar {
  background:#111827; color:#fff; padding:10px 16px; display:flex; justify-content:space-between; align-items:center;
}
.brand { font-weight:700; }
.topbar-actions { display:flex; align-items:center; gap:10px; font-size:13px; }
.btn-live { background:#16a34a; color:#fff; padding:8px 12px; border-radius:8px; text-decoration:none; font-weight:600; }
.btn-secondary { background:#374151; color:#fff; border:none; padding:8px 12px; border-radius:8px; cursor:pointer; }
.btn-primary { background:#2563eb; color:#fff; border:none; padding:10px; border-radius:8px; cursor:pointer; width:100%; font-weight:600; margin-top:6px; }

.layout { flex:1; display:flex; overflow:hidden; }
.sidebar { width:300px; background:#fff; overflow-y:auto; padding:12px; border-right:1px solid #e5e7eb; }
#map { flex:1; }

.panel { border-bottom:1px solid #e5e7eb; padding-bottom:14px; margin-bottom:14px; }
.panel h3 { margin:0 0 8px; font-size:13px; text-transform:uppercase; color:#6b7280; letter-spacing:0.5px; }
.panel input, .panel select { width:100%; padding:8px; margin-bottom:8px; border:1px solid #d1d5db; border-radius:6px; }
.panel label { display:block; font-size:13px; margin-bottom:6px; }
.hint { font-size:12px; color:#9ca3af; }

.mode-buttons { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.mode-btn { padding:8px; border:1px solid #d1d5db; background:#f9fafb; border-radius:6px; cursor:pointer; font-size:12px; }
.mode-btn.active { background:#2563eb; color:#fff; border-color:#2563eb; }

.item-list { max-height:160px; overflow-y:auto; font-size:12px; }
.item-row { padding:6px; border-bottom:1px solid #f3f4f6; display:flex; justify-content:space-between; align-items:center; }
.item-row button { border:none; background:none; color:#dc2626; cursor:pointer; font-size:12px; }
.tag { padding:2px 6px; border-radius:4px; font-size:10px; font-weight:600; }
.tag-open { background:#fee2e2; color:#dc2626; }
.tag-resolved { background:#dcfce7; color:#16a34a; }

/* Modal */
.modal { position:fixed; inset:0; background:rgba(0,0,0,0.5); display:flex; align-items:center; justify-content:center; z-index:1000; }
.modal-box { background:#fff; padding:24px; border-radius:12px; width:360px; max-height:80vh; overflow-y:auto; }
.modal-box input, .modal-box select { width:100%; padding:8px; margin-bottom:8px; border:1px solid #d1d5db; border-radius:6px; }
.modal-box hr { margin:16px 0; border:none; border-top:1px solid #e5e7eb; }
