/* Zone Management Styles */

/* Zone Controls Section */
.zone-controls {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 20px;
  min-height: 60px;
  display: flex;
  align-items: center;
}

.zone-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* Drawing Tools Group */
.drawing-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Drawing Status */
.drawing-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawing-mode-indicator {
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-primary);
}

.drawing-instruction {
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 12px;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Zone Buttons */
.zone-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.zone-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.zone-btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.zone-btn-primary:hover:not(:disabled) {
  background: #c41e3a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(225, 36, 36, 0.3);
}

.zone-btn-success {
  background: var(--color-accent);
  color: var(--color-black);
}

.zone-btn-success:hover:not(:disabled) {
  background: #d4a91a;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(230, 192, 31, 0.3);
}

.zone-btn-danger {
  background: #ef4444;
  color: var(--color-white);
}

.zone-btn-danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.zone-btn-secondary {
  background: #6b7280;
  color: var(--color-white);
}

.zone-btn-secondary:hover:not(:disabled) {
  background: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

/* Zone Info */
.zone-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.zone-count {
  font-weight: 600;
  color: var(--color-primary);
}

.selected-zone {
  font-weight: 500;
  color: #22c55e;
}

/* Navbar Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-zone-btn,
.navbar-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-accent);
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  color: var(--color-black);
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.navbar-zone-btn:hover,
.navbar-back-btn:hover {
  background: #d4a91a;
  border-color: #d4a91a;
  color: var(--color-black);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(230, 192, 31, 0.3);
}

/* Cursor styles for drawing */
.cursor-crosshair {
  cursor: crosshair !important;
}

.cursor-crosshair * {
  cursor: crosshair !important;
}

/* Zone polygon styles */
.zone-polygon .zone-shape {
  fill: rgba(34, 197, 94, 0.2);
  stroke: #22c55e;
  stroke-width: 2;
  cursor: pointer;
  transition: all 0.2s ease;
}

.zone-polygon .zone-shape:hover {
  fill: rgba(34, 197, 94, 0.4);
  stroke-width: 3;
}

.zone-polygon .zone-shape.selected {
  fill: rgba(59, 130, 246, 0.3);
  stroke: #3b82f6;
  stroke-width: 3;
}

.zone-label {
  fill: #22c55e;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Bio Sans', Arial, sans-serif;
  pointer-events: none;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.zone-label.selected {
  fill: #3b82f6;
}

/* Current drawing polygon */
.current-polygon .polygon-line {
  stroke: #ef4444;
  stroke-width: 2;
  pointer-events: none;
}

.current-polygon .polygon-point {
  fill: #ef4444;
  stroke: #ffffff;
  stroke-width: 2;
  transition: all 0.2s ease;
}

.current-polygon .polygon-point:hover {
  r: 6;
  stroke-width: 3;
}

.current-polygon .start-point-indicator {
  fill: rgba(239, 68, 68, 0.3);
  stroke: #ef4444;
  stroke-width: 2;
  stroke-dasharray: 3,3;
  animation: pulse-start 2s ease-in-out infinite;
}

/* Shape preview */
.shape-preview {
  fill: rgba(239, 68, 68, 0.3);
  stroke: #ef4444;
  stroke-width: 2;
  stroke-dasharray: 5,5;
  pointer-events: none;
  animation: dash 1s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -10;
  }
}

@keyframes pulse-start {
  0%, 100% {
    opacity: 0.6;
    r: 8;
  }
  50% {
    opacity: 1;
    r: 12;
  }
}

/* Cursor styles for drawing */
.cursor-crosshair {
  cursor: crosshair !important;
}

.cursor-crosshair * {
  cursor: crosshair !important;
}

.cursor-not-allowed {
  cursor: not-allowed !important;
}

.cursor-grab {
  cursor: grab !important;
}

.cursor-grabbing {
  cursor: grabbing !important;
}

.cursor-default {
  cursor: default !important;
}

/* Drawing mode visual feedback */
.floor-plan-image-container.cursor-crosshair::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(239, 68, 68, 0.05);
  border: 2px dashed rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  pointer-events: none;
  z-index: 1;
}

/* Info panel updates */
.info-icon-green {
  color: #22c55e;
}

.info-icon-orange {
  color: #f59e0b;
}

/* Loading state */
.loading-text {
  color: #f59e0b;
  font-style: italic;
  margin-left: 8px;
}

/* Drawing tools specific styles */
.drawing-tools .zone-btn {
  padding: 6px 12px;
  font-size: 13px;
  min-width: auto;
}

.drawing-tools .zone-btn svg {
  width: 14px;
  height: 14px;
}

/* Active drawing mode highlight */
.drawing-tools .zone-btn.active {
  background: #3b82f6;
  color: var(--color-white);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .zone-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .drawing-tools {
    order: 1;
    width: 100%;
    justify-content: center;
  }
  
  .zone-info {
    order: 2;
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
    justify-content: space-between;
  }
  
  .zone-management-page .floor-plan-info-panel {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .zone-controls {
    padding: 8px 16px;
  }
  
  .zone-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .drawing-tools {
    gap: 4px;
    padding: 2px;
  }
  
  .drawing-tools .zone-btn {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  .drawing-tools .zone-btn span {
    display: none;
  }
  
  .navbar-actions {
    gap: 8px;
  }
  
  .navbar-zone-btn,
  .navbar-back-btn {
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .drawing-status {
    text-align: center;
  }
  
  .drawing-mode-indicator {
    font-size: 13px;
  }
  
  .drawing-instruction {
    font-size: 11px;
  }
  
  .zone-management-page .floor-plan-info-panel {
    width: 280px;
    padding: 12px;
    gap: 12px;
  }
  
  .zone-card {
    padding: 12px;
    min-height: 120px;
  }
  
  .zone-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .zone-name {
    font-size: 14px;
  }
  
  .stat-box {
    padding: 8px;
    min-height: 50px;
  }
  
  .stat-icon {
    width: 24px;
    height: 24px;
  }
  
  .stat-value {
    font-size: 12px;
  }
  
  .zone-name-popup,
  .zone-edit-popup {
    min-width: 280px;
    max-width: 90vw;
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .zone-controls {
    padding: 6px 12px;
    min-height: 50px;
  }
  
  .zone-toolbar {
    gap: 4px;
  }
  
  .zone-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  
  .drawing-tools {
    gap: 2px;
    padding: 1px;
  }
  
  .drawing-tools .zone-btn {
    padding: 3px 6px;
    font-size: 10px;
  }
  
  .drawing-tools .zone-btn svg {
    width: 12px;
    height: 12px;
  }
  
  .zone-management-page .floor-plan-info-panel {
    width: 100%;
    height: auto;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid var(--color-border);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
  }
  
  .zone-management-page .floor-plan-card {
    flex-direction: column;
  }
  
  .zone-management-page .floor-plan-image-container {
    flex: 1;
  }
  
  .zone-card {
    padding: 10px;
    min-height: 100px;
  }
  
  .zone-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .zone-name {
    font-size: 13px;
  }
  
  .zone-id {
    font-size: 11px;
  }
  
  .stat-box {
    padding: 6px;
    min-height: 45px;
  }
  
  .stat-icon {
    width: 20px;
    height: 20px;
  }
  
  .stat-label {
    font-size: 9px;
  }
  
  .stat-value {
    font-size: 11px;
  }
  
  .stat-unit {
    font-size: 8px;
  }
  
  .zone-name-popup,
  .zone-edit-popup {
    min-width: 90vw;
    max-width: 95vw;
    padding: 12px;
  }
  
  .zone-name-popup h3,
  .zone-edit-popup h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  .popup-buttons {
    gap: 8px;
  }
  
  .popup-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Smooth transitions for all interactive elements */
.zone-btn,
.navbar-zone-btn,
.navbar-back-btn,
.zone-shape,
.polygon-point {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus states for accessibility */
.zone-btn:focus-visible,
.navbar-zone-btn:focus-visible,
.navbar-back-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Zone Name Popup */
.zone-name-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.zone-name-popup {
  background: var(--color-white);
  border-radius: 12px;
  padding: 24px;
  min-width: 320px;
  max-width: 400px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: popup-appear 0.2s ease-out;
}

.zone-edit-popup {
  background: var(--color-white);
  border-radius: 12px;
  padding: 24px;
  min-width: 400px;
  max-width: 500px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: popup-appear 0.2s ease-out;
}

@keyframes popup-appear {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.zone-name-popup h3,
.zone-edit-popup h3 {
  margin: 0 0 16px 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
  text-align: center;
}

.edit-section {
  margin-bottom: 20px;
}

.edit-label {
  display: block;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 8px;
}

.redraw-section {
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.redraw-description {
  margin: 0 0 12px 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.redraw-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 2px solid #f59e0b;
  border-radius: 8px;
  color: #f59e0b;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.redraw-btn:hover {
  background: #f59e0b;
  color: var(--color-white);
  transform: translateY(-1px);
}

.drawing-method-selection {
  text-align: center;
}

.drawing-method-selection p {
  margin: 0 0 16px 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.drawing-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.method-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.method-btn:hover {
  border-color: var(--color-primary);
  background: rgba(225, 36, 36, 0.05);
  color: var(--color-primary);
}

.zone-name-popup input,
.zone-edit-popup input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 14px;
  margin-bottom: 20px;
  transition: border-color 0.2s ease;
}

.zone-name-popup input:focus,
.zone-edit-popup input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.popup-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.popup-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.popup-btn-cancel {
  background: #6b7280;
  color: var(--color-white);
}

.popup-btn-cancel:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

.popup-btn-submit {
  background: var(--color-primary);
  color: var(--color-white);
}

.popup-btn-submit:hover {
  background: #c41e3a;
  transform: translateY(-1px);
}

/* Start point indicator animation */
.start-point-indicator {
  animation: pulse-start 2s ease-in-out infinite;
}

@keyframes pulse-start {
  0%, 100% {
    opacity: 0.6;
    r: 8;
  }
  50% {
    opacity: 1;
    r: 12;
  }
}

/* Polygon lines */
.polygon-line {
  pointer-events: none;
}
/* ======================================
   ZONE MANAGEMENT MAP LAYOUT ONLY
   ====================================== */

.zone-management-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.zone-management-page .dashboard-main {
  flex: 1;
  display: flex;
  padding: 16px;
  overflow: hidden;
}

.zone-management-page .floor-plan-card {
  flex: 1;
  display: flex;
  height: 100%;
  background: var(--color-white);
  border-radius: 12px;
  overflow: hidden;
}

/* MAP AREA */
.zone-management-page .floor-plan-image-container {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
  background: #f9fafb;
}

/* TRANSFORM LAYER */
.zone-management-page .floor-plan-content {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

/* FLOOR IMAGE */
.zone-management-page .floor-plan-image {
  position: absolute;
  top: 0;
  left: 0;
  user-select: none;
  pointer-events: none;
}

/* SVG OVERLAY */
.zone-management-page .floor-plan-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: all;
}

/* RIGHT SIDE PANEL */
.zone-management-page .floor-plan-info-panel {
  width: 350px;
  height: 100%;
  border-left: 1px solid var(--color-border);
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
}

/* Zone Details Panel */
.zone-details-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.zone-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-content svg {
  color: var(--color-primary);
}

.zone-details-header h3 {
  margin: 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
}

.zone-count-badge {
  background: linear-gradient(135deg, var(--color-primary), #c41e3a);
  color: var(--color-white);
  padding: 6px 10px;
  border-radius: 16px;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  min-width: 24px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(225, 36, 36, 0.2);
}

.no-zones-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  flex: 1;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 12px;
  border: 2px dashed var(--color-border);
}

.empty-state-icon {
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(225, 36, 36, 0.1);
  border-radius: 50%;
  color: var(--color-primary);
}

.no-zones-message h4 {
  margin: 0 0 8px 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--color-text);
}

.no-zones-message p {
  margin: 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.zone-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding-right: 4px;
}

.zone-list::-webkit-scrollbar {
  width: 6px;
}

.zone-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.zone-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.zone-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.zone-card {
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-height: 140px;
}

.zone-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), #c41e3a);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.zone-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(225, 36, 36, 0.15);
  transform: translateY(-2px);
}

.zone-card:hover::before {
  transform: scaleX(1);
}

.zone-card.selected {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(225, 36, 36, 0.05), rgba(225, 36, 36, 0.02));
  box-shadow: 0 6px 20px rgba(225, 36, 36, 0.2);
  transform: translateY(-2px);
}

.zone-card.selected::before {
  transform: scaleX(1);
}

.zone-card-header {
  margin-bottom: 16px;
}

.zone-info-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.zone-name-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.zone-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), #c41e3a);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(225, 36, 36, 0.3);
  flex-shrink: 0;
}

.zone-name-details {
  flex: 1;
  min-width: 0;
}

.zone-name {
  margin: 0 0 2px 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
  word-break: break-word;
  line-height: 1.2;
}

.zone-id {
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.zone-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.zone-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone-edit-btn {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.zone-edit-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #2563eb;
  transform: scale(1.05);
}

.zone-redraw-btn {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.zone-redraw-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #d97706;
  transform: scale(1.05);
}

.zone-delete-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.zone-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #dc2626;
  transform: scale(1.05);
}

.zone-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.zone-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  min-height: 60px;
}

.stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.points-icon {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.area-icon {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.stat-label {
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.stat-value-container {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.stat-value {
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.stat-unit {
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 9px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.zone-expanded-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  animation: expandIn 0.3s ease-out;
  background: rgba(248, 250, 252, 0.5);
  border-radius: 8px;
  padding: 12px;
}

@keyframes expandIn {
  from {
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin-top: 0;
  }
  to {
    opacity: 1;
    max-height: 200px;
    padding: 12px;
    margin-top: 12px;
  }
}

.expanded-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  margin-bottom: 6px;
  border: 1px solid rgba(226, 232, 240, 0.5);
}

.expanded-stat-row:last-child {
  margin-bottom: 0;
}

.expanded-label {
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.expanded-value {
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.status-active {
  color: #22c55e !important;
  font-weight: 700 !important;
}

/* Info Stats - Updated */
.info-stats {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

/* Info Controls - Updated */
.info-controls {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}


/* ======================================
   ZONE GROUPING STYLES
   ====================================== */

.zone-grouping-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.zone-grouping-panel {
  background: var(--color-white);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.zone-grouping-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 2px solid var(--color-border);
}

.zone-grouping-header h3 {
  margin: 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--color-text);
}

.zone-grouping-body {
  flex: 1;
  display: flex;
  gap: 24px;
  padding: 24px;
  overflow-y: auto;
  min-height: 0;
}

.zone-grouping-zones {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.zone-grouping-zones h4 {
  margin: 0 0 16px 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.zone-grouping-zones .empty-message {
  padding: 32px 16px;
  text-align: center;
  color: var(--color-text-secondary);
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 14px;
}

.group-zone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 8px;
  font-family: 'Bio Sans', Arial, sans-serif;
}

.group-zone-item:hover {
  border-color: var(--color-primary);
  background: rgba(225, 36, 36, 0.05);
}

.group-zone-item.selected {
  background: rgba(225, 36, 36, 0.1);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(225, 36, 36, 0.1);
}

.group-zone-item .zone-name {
  font-weight: 500;
  color: var(--color-text);
  flex: 1;
}

.group-zone-item .check-mark {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 18px;
  margin-left: 8px;
}

.zone-grouping-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.zone-grouping-form h4 {
  margin: 0 0 16px 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-field input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 14px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.form-field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(225, 36, 36, 0.1);
}

.form-field input:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
  opacity: 0.6;
}

.zone-grouping-form .zone-btn {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

/* Responsive adjustments for zone grouping */
@media (max-width: 768px) {
  .zone-grouping-panel {
    width: 95%;
    max-height: 90vh;
  }

  .zone-grouping-body {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .zone-grouping-zones,
  .zone-grouping-form {
    flex: 1;
  }

  .zone-grouping-header {
    padding: 16px;
  }

  .zone-grouping-header h3 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .zone-grouping-panel {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .zone-grouping-body {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .zone-grouping-header {
    padding: 12px;
  }

  .zone-grouping-header h3 {
    font-size: 16px;
  }

  .zone-grouping-zones h4,
  .zone-grouping-form h4 {
    font-size: 13px;
  }

  .group-zone-item {
    padding: 10px 12px;
    font-size: 13px;
  }

  .form-field input {
    padding: 10px 12px;
    font-size: 13px;
  }

  .zone-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}


/* ======================================
   ZONE GROUPING SELECTION STYLES
   ====================================== */

.zone-shape.grouping-selected {
  fill: rgba(245, 158, 11, 0.5);
  stroke: #f59e0b;
  stroke-width: 3;
  filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.7));
}

.zone-label.grouping-selected {
  fill: #f59e0b;
  font-weight: 700;
  font-size: 13px;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.8));
}

/* Group Info Styles */
.group-info {
  margin: 0 0 12px 0;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.group-zones-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.group-zone-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--color-primary), #c41e3a);
  color: var(--color-white);
  border-radius: 16px;
  font-family: 'Bio Sans', Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(225, 36, 36, 0.2);
}

@media (max-width: 480px) {
  .group-zones-list {
    padding: 8px;
    gap: 6px;
  }

  .group-zone-tag {
    padding: 4px 10px;
    font-size: 11px;
  }
}
