:root { 
  --font-size: 14px; 
  --primary-bg: #2c3e50;
  --accent-color: #3498db;
}

body {
  height: 100%;
  width: 100%;
  position: fixed;
  overflow: hidden;
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f6f6f6;
}

.toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: var(--primary-bg);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  z-index: 3000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.brand {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secondary-controls {
  display: none;
  position: absolute;
  top: 50px;
  right: 0;
  background: #34495e;
  padding: 10px 15px;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  border-bottom-left-radius: 8px;
  z-index: 2999;
}

.secondary-controls.expanded {
  display: flex;
}

.table-locked td {
  background-color: #fcfcfc;
  cursor: default;
  color: #888;
  outline: none;
}

.table-locked tr.selected td {
  background-color: #d0e7ff !important;
  color: #333;
}

#toggleEditBtn.locked {
  background: #e74c3c;
}

#toolbarMenuBtn i {
  transition: transform 0.3s ease;
}

.content-area {
  flex: 1;
  margin-top: 50px;
  padding: 10px;
  height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

button, .icon-btn-label {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover, .icon-btn-label:hover {
  background: var(--accent-color);
}

input[type="file"] {
  display: none;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-container i {
  position: absolute;
  left: 10px;
  color: #bdc3c7;
  font-size: 12px;
}

#searchInput {
  padding: 0 10px 0 30px;
  height: 32px;
  width: 200px;
  border-radius: 4px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: white;
}

#searchInput::placeholder {
  color: #bdc3c7;
}

#searchInput:focus {
  background: white;
  color: #333;
  outline: none;
}

#fontSizeSelect {
  height: 32px;
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0 5px;
}

#fontSizeSelect option {
  color: black;
}

.filters-hidden #fltrControls {
    display: none !important;
}

button#toggleFilterBtn.active {
    background: #e67e22 !important;
}

#fltrControls {
    transition: all 0.3s ease;
    box-sizing: border-box;
    width: 100%;
}

#fltrControls label {
    margin-bottom: 4px;
    color: #444;
}

#fltrControls input {
    border-radius: 4px;
    border: 1px solid #ccc;
    height: 30px;
}

#tableWrapper {
  flex: 1; 
  overflow: auto;
  background: white;
  border: 1px solid #ccc;
  min-height: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  min-width: max-content;
  font-size: var(--font-size);
}

th, td {
  border: 1px solid #ccc;
  padding: 6px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #eee;
}

th.resizable { position: relative; }
th.resizable .resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
}

#columnToggle {
  position: relative;
}

#columnList {
  display: none;
  position: absolute;
  top: 42px;
  right: 0; /* Aligns to right edge of button on desktop */
  background: white;
  border: 1px solid #ccc;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  padding: 10px;
  z-index: 4000;
  max-height: 400px;
  overflow-y: auto;
  min-width: 200px;
  color: #333;
}

#columnList label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  cursor: pointer;
}

#mapPanel {
  position: relative;
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease-in-out;
  border: 1px solid #ccc;
  margin-bottom: 10px;
  border-radius: 8px;
  clear: both;
}

#mapPanel.expanded { 
  height: 50vh;
}

#map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

tr.selected td {
  background-color: #d0e7ff !important;
}

@media (max-width: 600px) {
  .brand { 
    font-size: 1rem; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
  }
  
  #searchInput { 
    width: 100px; 
  }

  .secondary-controls {
    left: 0;
    border-radius: 0;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  #columnList {
    right: auto;
    left: 0;
    min-width: 250px;
    position: fixed;
    top: 100px;
    left: 10px;
    right: 10px;
  }
}