html, body {
  height: 100%;
  margin: 0;
}

#app {
  height: 100%;
  position: relative;
}

body.logged-out {
  background: radial-gradient(circle at top, #eff6ff 0%, #e0e7ff 40%, #f8fafc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.logged-out #app {
  height: auto;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}


#map {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

#auth-panel.panel {
  position: relative;
  width: min(300px, 92vw);
  padding: 32px 28px 36px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
  border: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(10px);
}

#auth-panel h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

#auth-panel p {
  margin: 0 0 8px;
  font-size: 15px;
  color: #475569;
}

#auth-forms form {
  display: flex;
  gap: 8px;
  flex-direction: column;
}

input[type="email"], input[type="password"], input[type="text"] {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: rgba(248, 250, 252, 0.8);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.35);
}

button {
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.link {
  background: transparent;
  color: #2563eb;
  padding: 0 4px;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

.message {
  margin-top: 8px;
  font-size: 13px;
  color: #0f172a;
}

.overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  width: min(400px, 90vw);
  max-height: calc(100vh - 32px);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.overlay.hidden { display: none; }

.overlay.is-collapsed {
  display: none;
}


.panel-expander-button {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  color: #1d4ed8;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel-expander-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.panel-expander.hidden {
  display: none;
}

.panel-expander-group {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 900;
}

.panel-expander-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.overlay:not(.hidden) ~ .panel-expander-group .panel-expander-button {
  display: none;
}

.overlay.hidden ~ .panel-expander-group .panel-expander-button {
  display: inline-flex;
}

.overlay-header, .overlay-footer {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.overlay-header {
  flex-direction: column;
  align-items: stretch;
}

.overlay-header .title {
  font-weight: 700;
}

.overlay-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

#status-filters {
  flex: 1 1 100%;
}

.overlay-actions > * {
  max-width: 100%;
}

.overlay-actions .link,
.overlay-actions a.link {
  white-space: normal;
  line-height: 1.15;
}

.overlay-footer {
  justify-content: space-between;
}

.user-admin {
  margin: 12px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
}

.user-admin summary {
  font-weight: 600;
  color: #1d4ed8;
  cursor: pointer;
}

.user-admin-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.orders-list {
  overflow: auto;
  padding: 8px 8px 12px 8px;
}

.order-item {
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 10px;
  padding: 14px 14px 12px 14px;
  margin: 8px;
  cursor: pointer;
  font-size: 16px;
}

.order-item:hover {
  background: #f8fafc;
}

.order-item.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2), 0 10px 22px rgba(37, 99, 235, 0.18);
}

.order-item.is-active:hover {
  background: #eff6ff;
}

.order-meta {
  font-size: 14px;
  color: #475569;
}

.order-title { font-size: 18px; }
.order-comment { font-size: 15px; color: #334155; margin-top: 6px; white-space: pre-wrap; }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: white;
}

/* Status colors */
.status-new { background: #14b8a6; }        /* Новый (бирюзовый) */
.status-inprogress { background: #facc15; } /* В работе (желтый) */
.status-scheduled { background: #3b82f6; }  /* В графике (синий) */
.status-completed { background: #22c55e; }  /* Готово (зеленый) */
.status-problem { background: #ef4444; }    /* Проблемный (красный) */

.toggle { display: flex; align-items: center; gap: 6px; }

@media (max-width: 640px) {
  .overlay {
    width: calc(100vw - 24px);
    left: 12px;
    top: 12px;
    max-height: calc(100vh - 24px);
  }
  .panel {
    width: calc(100vw - 24px);
    left: 12px;
    top: 12px;
  }
}
