body {
  margin: 0;
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  background: #f6f8fa;
  color: #222;
}
.container {
  display: flex;
  height: 100vh;
  width: 100vw;
}
.sidebar {
  width: 21vw;
  min-width: 260px;
  max-width: 420px;
  background: #232946;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 0 0.7rem 0 0;
  box-shadow: 2px 0 8px rgba(0,0,0,0.04);
  z-index: 2;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1rem 0.6rem 1rem;
  border-bottom: 1px solid #394867;
}
.header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}
#add-address-btn {
  background: #3e92cc;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background 0.2s;
}
#add-address-btn:hover {
  background: #2563eb;
}
#address-list {
  flex: 1 1 auto;
  list-style: none;
  margin: 0;
  padding: 0.4rem 0.2rem 0.4rem 0.8rem;
  overflow-y: auto;
  /* Add a little right margin to keep items away from the edge */
  margin-right: 0.3rem;
}
#address-list li {
  background: #393e6a;
  margin-bottom: 0.7rem;
  border-radius: 8px;
  padding: 0.7rem 1.1rem 0.7rem 1.4rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border: 2px solid transparent;
  transition: border 0.2s, background 0.2s;
}
#address-list li.selected {
  border: 2px solid #3e92cc;
  background: #232946;
}
#address-list li .actions {
  margin-top: 0.2rem;
  display: flex;
  gap: 0.5rem;
}
#address-list li button {
  background: none;
  border: none;
  color: #f7c873;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.2rem;
  transition: color 0.2s;
}
#address-list li button:hover {
  color: #e84545;
}
.sidebar-actions {
  padding: 0.8rem 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-actions button {
  background: #3e92cc;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.sidebar-actions button:hover {
  background: #2563eb;
}
.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
}
.map-toolbar {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.5rem 0.5rem 1.5rem;
  background: #f6f8fa;
  border-bottom: 1px solid #e0e6ed;
  z-index: 1;
}
.map-toolbar button {
  background: #232946;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.45rem 1.1rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.map-toolbar button:hover {
  background: #3e92cc;
}
#map {
  flex: 1 1 auto;
  height: 100%;
  width: 100%;
  min-height: 400px;
  z-index: 0;
}
.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(44,62,80,0.18);
  padding: 2rem 2.5rem 1.5rem 2.5rem;
  z-index: 10;
  min-width: 320px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.2s;
}
.modal.hidden {
  display: none;
}
#overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(44,62,80,0.18);
  z-index: 9;
}
#overlay.hidden {
  display: none;
}
#address-form label {
  font-size: 1rem;
  color: #232946;
  display: flex;
  flex-direction: column;
  margin-bottom: 0.7rem;
}
#address-form input, #address-form select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #c9d6e3;
  border-radius: 5px;
  font-size: 1rem;
  margin-top: 0.2rem;
  background: #f6f8fa;
  outline: none;
  transition: border 0.2s;
}
#address-form input:focus, #address-form select:focus {
  border: 1.5px solid #3e92cc;
}
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.form-actions button {
  background: #232946;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.4rem 1.1rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.form-actions button:hover {
  background: #3e92cc;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -56%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
@media (max-width: 900px) {
  .sidebar { min-width: 120px; }
  .modal { min-width: 220px; padding: 1.2rem 1rem; }
}
