* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  background: linear-gradient(135deg, #23272a 0%, #2c2f33 100%);
  color: #dcddde;
  min-height: 100vh;
  overflow-x: auto;
}

.header {
  text-align: center;
  padding: 32px 0 16px 0;
  background: #23272a;
  border-bottom: 2px solid #5865f2;
  margin-bottom: 32px;
}

.header h1 {
  font-size: 2.5em;
  color: #5865f2;
  text-shadow: 0 0 12px #5865f2;
  margin-bottom: 8px;
}

.header p {
  color: #dcddde;
  font-size: 1.1em;
}

.nav-links {
  text-align: center;
  margin-bottom: 32px;
}

.nav-links a {
  color: #00ff41;
  text-decoration: none;
  margin: 0 12px;
  padding: 8px 18px;
  border: 1px solid #00ff41;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
  background: #00ff41;
  color: #23272a;
}

.container {
  max-width: 1400px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

.login-panel {
  max-width: 400px;
  margin: 60px auto;
  background: #23272a;
  border: 2px solid #ff3838;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}

.admin-content { display: none; }
.admin-content.active { display: block; }

.admin-section {
  background: #2c2f33;
  border: 1px solid #5865f2;
  border-radius: 10px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.admin-section h3 {
  color: #00ff41;
  margin-bottom: 18px;
  font-size: 1.3em;
}

.form-group { margin: 18px 0; }

.form-group label {
  display: block;
  color: #32ff7e;
  margin-bottom: 6px;
  font-weight: bold;
}

.form-input, .form-select, .password-input {
  width: 100%;
  padding: 12px;
  background: #23272a;
  border: 1.5px solid #5865f2;
  color: #00ff41;
  border-radius: 6px;
  font-size: 1em;
  margin-bottom: 8px;
  transition: border 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .password-input:focus {
  outline: none;
  border-color: #00ff41;
  box-shadow: 0 0 8px #00ff4144;
}

.coordinates-info {
  background: rgba(0,255,65,0.08);
  border: 1px solid #00ff41;
  padding: 12px;
  border-radius: 6px;
  font-size: 0.98em;
  margin: 10px 0;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.admin-button {
  background: #5865f2;
  color: #fff;
  border: none;
  padding: 12px 22px;
  margin: 8px 5px;
  cursor: pointer;
  font-size: 1em;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.admin-button:hover {
  background: #4752c4;
  transform: translateY(-2px);
}

.admin-button.danger { background: #ff3838; }
.admin-button.danger:hover { background: #ff6b7a; }
.admin-button.success { background: #00ff41; color: #23272a; }
.admin-button.success:hover { background: #32ff7e; }

.data-display, .log-panel {
  background: #18191c;
  border: 1px solid #5865f2;
  padding: 14px;
  border-radius: 6px;
  max-height: 300px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #00ff41;
}

.log-panel { height: 200px; }
.log-entry { margin: 2px 0; padding: 2px 5px; }
.log-entry.error { color: #ff3838; }
.log-entry.success { color: #32ff7e; }
.log-entry.warning { color: #ffeb3b; }

.map-container, .map-preview {
  width: 100%;
  max-width: 1400px;
  height: 950px;
  border: 2px solid #00ff41;
  border-radius: 12px;
  background: #18191c;
  background-image: url('./callous_row_map.png');
  background-size: cover;
  background-position: center;
  position: relative;
  margin: 24px auto;
  overflow: hidden;
}

.map-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 15, 35, 0.2);
  pointer-events: none;
  z-index: 1;
}

.map-container {
    position: relative;
    background: #0f0f23;
    background-image: url('./callous_row_map.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 20px;
    margin: 20px auto;
    width: 1200px;
    height: 800px;
    overflow: hidden;
}

.map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 35, 0.2);
    pointer-events: none;
    z-index: 1;
}

.map-item, .apartment, .store {
  position: absolute;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.8), 0 0 5px rgba(255, 255, 255, 0.3);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  width: 20px;
  height: 20px;
}

.map-item:hover {
  transform: scale(1.3);
  z-index: 200;
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.8);
}

.map-item.focused {
  box-shadow: 0 0 40px #00ff41, 0 0 10px #fff;
  border: 3px solid #00ff41;
  z-index: 300;
  transform: scale(1.3);
}

.apartment.small { background: #ffeb3b; border: 2px solid #ffc107; color: #000; }
.apartment.medium { background: #00ff41; border: 2px solid #32ff7e; color: #000; }
.apartment.hotel { background: #9c27b0; border: 2px solid #ba68c8; color: #fff; }
.apartment.occupied { background: #ff3838 !important; border: 2px solid #ff6b7a !important; color: #fff !important; }
.store {
  background: #ff8c00;
  border: 2px solid #ffa500;
  color: #000;
}
.store.occupied {
  background: #ff3838 !important;
  border: 2px solid #ff6b7a !important;
  color: #fff !important;
}

.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
  padding: 20px;
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid #00ff41;
  border-radius: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  border: 2px solid;
}

.legend-icon.occupied { background: #ff3838; border-color: #ff6b7a; color: #fff; }
.legend-icon.store { background: #ff8c00; border-color: #ffa500; color: #000; width: 24px; height: 24px; }

.info-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 20px auto;
  max-width: 1400px;
  width: 100%;
}

.info-panel {
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid #00ff41;
  border-radius: 10px;
  padding: 20px;
}

.info-panel h3 {
  color: #00ff41;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.item-list { max-height: 300px; overflow-y: auto; }
.item-entry {
  padding: 10px;
  margin: 5px 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  border-left: 3px solid #00ff41;
  cursor: pointer;
  transition: all 0.3s ease;
}

.item-entry:hover { background: rgba(0, 255, 65, 0.2); }
.item-entry.occupied { border-left-color: #ff3838; }
.item-name { font-weight: bold; color: #00ff41; }
.item-details { font-size: 0.9em; color: #ccc; margin-top: 5px; }

.tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.95);
  color: #00ff41;
  padding: 15px;
  border: 2px solid #00ff41;
  border-radius: 10px;
  font-size: 14px;
  pointer-events: none;
  z-index: 1000;
  display: none;
  max-width: 300px;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.tooltip h4 { color: #32ff7e; margin-bottom: 8px; }
.tooltip-line { margin: 3px 0; }

.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  padding: 20px;
  border: 2px solid #00ff41;
  border-radius: 10px;
  color: #00ff41;
  z-index: 2000;
}

.stats-panel {
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid #00ff41;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.stat-item {
  text-align: center;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
}

.stat-number {
  font-size: 2em;
  font-weight: bold;
  color: #32ff7e;
}

.stat-label {
  color: #00ff41;
  margin-top: 5px;
}

ul, ol {
  background: #23272a;
  border-radius: 8px;
  padding: 12px 18px;
  margin: 10px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  border: 1px solid #5865f2;
}

li {
  padding: 10px 8px;
  margin: 6px 0;
  border-radius: 6px;
  background: #2c2f33;
  color: #dcddde;
  transition: background 0.2s;
}

li:hover {
  background: #5865f2;
  color: #fff;
}

::-webkit-scrollbar { width: 10px; background: #23272a; }
::-webkit-scrollbar-thumb { background: #5865f2; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #4752c4; }
html { scrollbar-color: #5865f2 #23272a; scrollbar-width: thin; }

.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-indicator.online { background: #00ff41; }
.status-indicator.offline { background: #ff3838; }

@media (max-width: 1280px) {
  .map-container { width: 100%; max-width: 1200px; height: 800px; }
}

@media (max-width: 768px) {
  .info-panels { grid-template-columns: 1fr; }
  .legend { flex-direction: column; align-items: center; }
}
