* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  font-size: 13px; color: #222; background: #f3f4f6; }
button { font: inherit; cursor: pointer; border: 1px solid #c9ced8; background: #fff; border-radius: 6px; padding: 5px 10px; }
button:hover { background: #f0f3f9; }
button.primary { background: #2f6fd6; border-color: #2f6fd6; color: #fff; }
button.primary:hover { background: #255fbe; }
button.danger { color: #b42323; }
button:disabled { color: #aaa; cursor: not-allowed; background: #f6f6f6; }
input, select { font: inherit; padding: 6px 8px; border: 1px solid #c9ced8; border-radius: 6px; width: 100%; background: #fff; }
.error { color: #b42323; min-height: 1.2em; margin-top: 8px; white-space: pre-wrap; }
.muted { color: #888; }

/* 로그인 */
.login-page { display: flex; align-items: center; justify-content: center; }
.login-box { width: 320px; background: #fff; padding: 28px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0, 0, 0, .08); }
.login-box h1 { margin: 0 0 18px; font-size: 20px; }
.login-box h1 small { font-size: 13px; color: #888; font-weight: normal; }
.login-box label { display: block; margin-bottom: 12px; color: #555; }
.login-box label input { margin-top: 4px; }
.login-box button { width: 100%; padding: 9px; }

/* 관리 화면 */
header { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: #1f2937; color: #fff; }
header h1 { font-size: 16px; margin: 0; flex: 1; }
header h1 small { color: #9ca3af; font-weight: normal; font-size: 12px; margin-left: 6px; }
header .me { color: #cbd5e1; }
header button { background: transparent; color: #e5e7eb; border-color: #4b5563; }
header button:hover { background: #374151; }
main { position: absolute; top: 48px; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: minmax(640px, 60%) 1fr; }
#side { overflow: auto; padding: 14px; border-right: 1px solid #dde1e7; }
#list { overflow-x: auto; }
#map { position: relative; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.toolbar .count { color: #555; }
.toolbar .spacer { flex: 1; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid #eef0f3; vertical-align: middle; white-space: nowrap; }
th { background: #f8f9fb; color: #555; font-weight: 600; font-size: 12px; }
tr.selected td { background: #eef4ff; }
.actions { display: flex; gap: 4px; flex-wrap: nowrap; }
.actions button { padding: 3px 7px; font-size: 12px; }
td .sub { color: #777; font-size: 12px; margin-top: 2px; }
b.armed { color: #b42323; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #e5e7eb; color: #374151; }
.badge.running { background: #dcf3e2; color: #17723a; }
.badge.starting { background: #fdf3d7; color: #8a6200; }
.badge.error { background: #fde3e3; color: #b42323; }
.kind { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.kind.copter { background: #2f6fd6; } .kind.rover { background: #1f9d55; } .kind.boat { background: #e8710a; }
.conn { font-family: Consolas, monospace; font-size: 12px; }
.empty { padding: 30px; text-align: center; color: #888; background: #fff; border-radius: 8px; }
h2 { font-size: 14px; margin: 18px 0 8px; color: #444; }
.events { background: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: #555; max-height: 220px; overflow: auto; }
.events div { padding: 2px 0; }
.events b { color: #333; font-weight: 600; }

/* 지도 위 기체 표시 */
.vmarker { display: flex; flex-direction: column; align-items: center; pointer-events: auto; cursor: pointer; }
.vmarker .arrow { width: 22px; height: 22px; }
.vmarker .label { margin-top: 1px; padding: 1px 6px; border-radius: 8px; background: rgba(255, 255, 255, .92);
  font-size: 11px; color: #222; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); white-space: nowrap; }
.pick-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; background: #2f6fd6; color: #fff;
  padding: 7px 14px; border-radius: 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); display: none; }

/* 대화상자 */
dialog { border: 0; border-radius: 12px; padding: 20px 22px; width: 420px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
dialog h3 { margin: 0 0 14px; font-size: 16px; }
dialog .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
dialog label { display: block; color: #555; }
dialog label input, dialog label select { margin-top: 4px; }
dialog .full { grid-column: 1 / -1; }
dialog .buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
dialog.log { width: min(900px, 92vw); }
dialog.log pre { background: #111827; color: #d1d5db; padding: 12px; border-radius: 8px; max-height: 60vh; overflow: auto;
  font-size: 12px; white-space: pre-wrap; }
