* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: #f4f6f8; color: #1a1d21; }
.hidden { display: none !important; }
.muted { color: #6b7280; font-weight: 400; font-size: 0.85em; }
.error { color: #d33; font-size: 0.85em; min-height: 1em; margin-top: 6px; }

.view { min-height: 100vh; }

/* Логин */
.login-card { max-width: 360px; margin: 10vh auto; padding: 28px; }
.login-card h1 { margin: 0 0 4px; font-size: 1.5em; }

.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }

label { display: block; font-size: 0.85em; margin: 12px 0 4px; }
input { width: 100%; padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.95em; }
input:focus { outline: 2px solid #3b82f6; border-color: transparent; }

.btn { padding: 9px 14px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; cursor: pointer; font-size: 0.9em; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: #6b7280; }
.btn:hover { filter: brightness(1.05); }

/* Дашборд */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.brand { font-weight: 700; font-size: 1.05em; }
.actions { display: flex; gap: 8px; }

.layout { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 53px); }

.sidebar { background: #fff; border-right: 1px solid #e5e7eb; padding: 14px; overflow-y: auto; }
.sidebar h3 { margin: 8px 0; font-size: 0.8em; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 0.9em; }
.list li:hover { background: #f3f4f6; }
.list li.active { background: #e0edff; }

.route-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; align-items: center; }
.route-actions .btn { flex: 1; }

.content { position: relative; }
#map { position: absolute; inset: 0; }
.map-status { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: #fff; padding: 4px 12px; border-radius: 20px; box-shadow: 0 1px 6px rgba(0,0,0,.15); z-index: 500; }

/* Модалка */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-card { background: #fff; border-radius: 14px; width: 640px; max-width: 95vw; max-height: 90vh; overflow-y: auto; padding: 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }

.stops { margin: 10px 0; }
.stop-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: #f9fafb; border-radius: 8px; margin: 4px 0; font-size: 0.9em; }

.stop-add { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.stop-add .grow { flex: 1; min-width: 220px; }

.suggest { position: absolute; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.15); max-height: 240px; overflow-y: auto; width: 400px; z-index: 10; }
.suggest div { padding: 9px 12px; cursor: pointer; font-size: 0.9em; }
.suggest div:hover { background: #f3f4f6; }

@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { max-height: 200px; }
}
