
  .cargo-tabs {
    display: flex;
    gap: 8px;
    width: 240px;
}
:root {
  --primary:#2563eb;
  --bg:#f8fafc;
  --card:#ffffff;
  --border:#e5e7eb;
  --text:#0f172a;
}

* { box-sizing:border-box; }

html,body {
  margin:0;
  height:100%;
  font-family:Inter,system-ui,sans-serif;
  background:var(--bg);
  color:var(--text);
}

.container {
  display:flex;
  height:100vh;
}

/* LEFT */
.left-panel {
  width:420px;
  display:flex;
  flex-direction:column;
  border-right:1px solid var(--border);
  background:#fff;
}

.form-panel {
  padding:16px;
  overflow:auto;
  flex:1;
}

h1 {
  font-size:18px;
  margin:0 0 12px;
}


.tab {
  flex:1;
  padding:8px;
  text-align:center;
  border-radius:8px;
  font-size:12px;
  cursor:pointer;
  background:#f1f5f9;
}

.tab.active {
  background:var(--primary);
  color:#fff;
}

.tab-content { display:none; }
.tab-content.active { display:block; }

.form-section {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  margin-bottom:12px;
}

.section-title {
  font-weight:700;
  font-size:13px;
  color:var(--primary);
  margin-bottom:8px;
}

.form-group {
  margin-bottom:10px;
}

label {
  font-size:12px;
  font-weight:600;
  display:block;
  margin-bottom:4px;
}

input, select, textarea {
  /* width:100%; */
  padding:8px 10px;
  border-radius:8px;
  border:1px solid var(--border);
  font-size:13px;
}
select, textarea {
  width:100%;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid var(--border);
  font-size:13px;
}

textarea { resize:vertical; }

.radio-group {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
}

.radio-option {
  display:flex;
  gap:6px;
  font-size:12px;
}

.color-picker {
  display:flex;
  gap:8px;
  align-items:center;
}

.draw-buttons {
  display:flex;
  gap:8px;
}

button {
  padding:9px;
  border:none;
  border-radius:10px;
  font-weight:600;
  cursor:pointer;
  background:var(--primary);
  color:#fff;
  flex:1;
}

button.cancel {
  background:#e5e7eb;
  color:#111;
}

button.submit-btn {
  width:100%;
  margin-top:10px;
}

.coordinates-container {
  font-size:11px;
  background:#020617;
  color:#22c55e;
  padding:8px;
  border-radius:8px;
  max-height:120px;
  overflow:auto;
}

.coordinates-container div {
  border-bottom:1px dashed #334155;
  padding:2px 0;
}

/* RIGHT */
.map-panel {
  flex:1;
  position:relative;
}

#map {
  width:100%;
  height:100%;
}

.map-controls {
  position:absolute;
  top:12px;
  right:12px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.map-controls button {
  padding:6px 10px;
  font-size:12px;
}

        
        .container {
            display: flex;
            gap: 20px;
            max-width: 100%;
            margin: 0 auto;
            height: calc(100vh - 40px);
        }
        
        .left-panel {
            width: 450px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .form-panel, .list-panel {
            background: white;
            border-radius: 8px;
            padding: 2px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        
        .form-panel {
            flex: 1;
            overflow-y: auto;
        }
        
        .list-panel {
            flex: 1;
            overflow-y: auto;
        }
        
        .map-panel {
            flex: 1;
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            position: relative;
        }
        
        h1, h2 {
            color: #2c3e50;
            margin-bottom: 15px;
            font-size: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid #3498db;
        }
        
        h2 {
            font-size: 18px;
            border-bottom: 1px solid #3498db;
        }
        
        h3 {
            font-size: 16px;
            margin-bottom: 10px;
            color: #2c3e50;
        }
        
        .tab-container {
            display: flex;
            gap: 4px;
            margin-bottom: 5px;
            border-bottom: 1px solid #eee;
            padding-bottom: 6px;
            flex-wrap: wrap;
        }
        
        .tab {
            padding: 7px 7px;
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .tab.active {
            background: #3498db;
            color: white;
            border-color: #3498db;
        }
        
        .tab:hover:not(.active) {
            background: #e9ecef;
        }
        
        .form-section {
            margin-bottom: 25px;
        }
        
        .section-title {
            font-size: 16px;
            font-weight: 600;
            color: #2c3e50;
            margin-bottom: 15px;
            padding-bottom: 8px;
            border-bottom: 1px solid #eee;
        }
        
        .form-group {
            margin-bottom: 15px;
        }
        
        label {
            display: block;
            margin-bottom: 6px;
            font-weight: 500;
            color: #555;
            font-size: 14px;
        }
        
        .required::after {
            content: " *";
            color: #e74c3c;
        }
        
        input, select, textarea {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            transition: border 0.2s;
        }
        
        input:focus, select:focus, textarea:focus {
            outline: none;
            border-color: #3498db;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
        }
        
        textarea {
            height: 80px;
            resize: vertical;
            font-family: inherit;
        }
        
        .checkbox-group, .radio-group {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 10px;
        }
        
        .checkbox-group label, .radio-group label {
            margin-bottom: 0;
            cursor: pointer;
        }
        
        input[type="checkbox"], input[type="radio"] {
            width: auto;
            cursor: pointer;
        }
        
        .radio-group {
            display: flex;
            gap: 20px;
            flex-wrap: wrap;
        }
        
        .radio-option {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .draw-controls {
            background: #f8f9fa;
            border-radius: 6px;
            padding: 15px;
            margin-bottom: 20px;
            border: 1px solid #e9ecef;
        }
        
        .draw-buttons {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 15px;
        }
        
        .draw-buttons button {
            padding: 10px;
            border: none;
            border-radius: 4px;
            background: #3498db;
            color: white;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .draw-buttons button:hover {
            background: #2980b9;
            transform: translateY(-1px);
        }
        
        .draw-buttons button.active {
            background: #1a5276;
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
        }
        
        .draw-buttons button.cancel {
            background: #e74c3c;
        }
        
        .draw-buttons button.cancel:hover {
            background: #c0392b;
        }
        
        .instructions {
            color: #7f8c8d;
            font-size: 13px;
            font-style: italic;
            line-height: 1.4;
            background: #fef9e7;
            padding: 10px;
            border-radius: 4px;
            border-left: 3px solid #f1c40f;
        }
        
        
        .coordinates-container {
            max-height: 200px;
            overflow-y: auto;
            background: #000000;
            border-radius: 4px;
            padding: 10px;
            margin-top: 10px;
            border: 1px solid #eee;
        }
        
        .coordinate-item {
            padding: 8px 10px;
            background: white;
            margin-bottom: 5px;
            border-radius: 3px;
            font-family: 'Courier New', monospace;
            font-size: 12px;
            border-left: 3px solid #3498db;
        }
        
        .coordinate-item:last-child {
            margin-bottom: 0;
        }
        
        .submit-btn {
            padding: 10px;
            background: #2ecc71;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 10px;
            width: 100%;
        }
        
        .submit-btn:hover {
            background: #27ae60;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
        }
        
        .submit-btn:disabled {
            background: #95a5a6;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }
        
        .btn-secondary {
            padding: 15px;
            background: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 10px;
            width: 100%;
        }
        
        .btn-secondary:hover {
            background: #2980b9;
            transform: translateY(-2px);
        }
        
        #map {
            height: 100%;
        }
        
        .response-message {
            margin-top: 20px;
            padding: 15px;
            border-radius: 4px;
            font-size: 14px;
            display: none;
            animation: fadeIn 0.3s ease;
        }
        
        .response-message.success {
            background: #d5edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        
        .response-message.error {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        
        .response-message.info {
            background: #d1ecf1;
            color: #0c5460;
            border: 1px solid #bee5eb;
        }
        
        .geofence-list {
            margin-top: 15px;
        }
        
        .geofence-item {
            padding: 12px;
            background: #f8f9fa;
            border-radius: 4px;
            margin-bottom: 10px;
            border-left: 4px solid #3498db;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .geofence-item:hover {
            background: #e9ecef;
            transform: translateX(2px);
        }
        
        .geofence-item.selected {
            background: #d1ecf1;
            border-left-color: #2ecc71;
        }
        
        .geofence-type {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            margin-right: 8px;
        }
        
        .type-route {
            background: #3498db;
            color: white;
        }
        
        .type-station {
            background: #9b59b6;
            color: white;
        }
        
        .type-hotspot {
            background: #e74c3c;
            color: white;
        }
        
        .type-regular {
            background: #95a5a6;
            color: white;
        }
        
        .geofence-name {
            font-weight: 600;
            margin-bottom: 4px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .geofence-description {
            font-size: 13px;
            color: #666;
            margin-bottom: 4px;
        }
        
        .geofence-actions {
            display: flex;
            gap: 10px;
            margin-top: 8px;
            flex-wrap: wrap;
        }
        
        .action-btn {
            padding: 4px 12px;
            border: 1px solid #ddd;
            background: white;
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .action-btn:hover {
            background: #f0f0f0;
        }
        
        .action-btn.assign {
            background: #2ecc71;
            color: white;
            border-color: #2ecc71;
        }
        
        .action-btn.assign:hover {
            background: #27ae60;
        }
        
        .action-btn.edit {
            background: #3498db;
            color: white;
            border-color: #3498db;
        }
        
        .action-btn.edit:hover {
            background: #2980b9;
        }
        
        .action-btn.delete {
            background: #e74c3c;
            color: white;
            border-color: #e74c3c;
        }
        
        .action-btn.delete:hover {
            background: #c0392b;
        }
        
        .action-btn.view {
            background: #9b59b6;
            color: white;
            border-color: #9b59b6;
        }
        
        .action-btn.view:hover {
            background: #8e44ad;
        }
        
        .station-list {
            max-height: 300px;
            overflow-y: auto;
            margin-top: 10px;
        }
        
        .station-item {
            padding: 8px;
            background: #f8f9fa;
            border-radius: 4px;
            margin-bottom: 5px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        
        .station-info {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .station-type {
            font-size: 11px;
            background: #9b59b6;
            color: white;
            padding: 2px 6px;
            border-radius: 10px;
        }
        
        .device-assignment {
            background: #f8f9fa;
            border-radius: 6px;
            padding: 15px;
            margin-top: 20px;
            border: 1px solid #e9ecef;
        }
        
        .form-scroll {
            flex: 1;
            overflow-y: auto;
            padding-right: 5px;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        .field-group {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }
        
        .color-picker {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .color-picker {
        position: static !important;
        right: 0;
        }
        
        .color-picker input[type="color"] {
            width: 40px;
            height: 40px;
            padding: 0;
            border: 1px solid #ddd;
            border-radius: 4px;
            cursor: pointer;
        }
        
        .map-controls {
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 1000;
            background: white;
            border-radius: 4px;
            padding: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        
        .map-controls button {
            padding: 8px 12px;
            background: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .map-controls button:hover {
            background: #2980b9;
        }
        
        .map-controls button.active {
            background: #1a5276;
        }
        
        .legend {
            position: absolute;
            bottom: 10px;
            left: 10px;
            background: white;
            border-radius: 4px;
            padding: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            z-index: 1000;
        }
        
        .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 5px;
        }
        
        .legend-color {
            width: 20px;
            height: 10px;
            border-radius: 2px;
        }
        
        .legend-route {
            background: #3498db;
        }
        
        .legend-station {
            background: #9b59b6;
        }
        
        .legend-hotspot {
            background: #e74c3c;
        }
        
        .legend-geofence {
            background: #95a5a6;
        }
        
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 2000;
            align-items: center;
            justify-content: center;
        }
        
        .modal-content {
            background: white;
            border-radius: 8px;
            padding: 25px;
            width: 90%;
            max-width: 600px;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 4px 20px rgba(0,0,0,0.2);
        }
        
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid #3498db;
        }
        
        .close-modal {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #666;
        }
        
        .close-modal:hover {
            color: #333;
        }
        
        .status-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            margin-left: 8px;
        }
        
        .status-active {
            background: #d5edda;
            color: #155724;
        }
        
        .status-inactive {
            background: #f8d7da;
            color: #721c24;
        }
        
        .status-maintenance {
            background: #fff3cd;
            color: #856404;
        }
        
        .action-icons {
            display: flex;
            gap: 8px;
        }
        
        .action-icon {
            cursor: pointer;
            color: #666;
            transition: color 0.2s;
        }
        
        .action-icon:hover {
            color: #3498db;
        }
        
        .action-icon.delete:hover {
            color: #e74c3c;
        }
        
        .filter-controls {
            background: #f8f9fa;
            border-radius: 6px;
            padding: 15px;
            margin-bottom: 15px;
            border: 1px solid #e9ecef;
        }
        
        .filter-options {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 10px;
        }
        
        .filter-option {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .search-box {
            margin-bottom: 15px;
        }
        
        .search-box input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }
        
        .edit-mode {
            background: #fff3cd !important;
            border-left-color: #f1c40f !important;
        }
